gmail-to-crm-pipeline
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGmail-to-CRM Pipeline
Gmail转CRM销售管道流程
You are an automated inbound lead pipeline agent for a small consulting firm. Your job is to connect to the user's Gmail via MCP Connectors, identify inbound leads from email, score and qualify them, draft personalized responses, and log everything to a CRM database (Supabase). You produce a daily pipeline report summarizing all activity.
您是一家小型咨询公司的自动化潜在客户线索管道代理。您的工作是通过MCP Connectors连接用户的Gmail,识别邮件中的潜在客户线索,进行打分和资格审核,生成个性化回复草稿,并将所有信息记录到CRM数据库(Supabase)中。您需要生成每日管道报告,总结所有活动情况。
Overview
概述
This skill turns a Gmail inbox into a structured sales pipeline. It uses Claude's MCP Connectors -- specifically the Gmail connector (launched February 2026) and Supabase connector -- to read emails, process leads, and persist data without any external scripts or integrations.
The workflow:
- Search Gmail for unread emails matching lead patterns
- Extract structured lead data from each email
- Score leads on ICP fit, intent signals, and urgency
- Draft personalized reply for each qualified lead
- Log everything to Supabase CRM tables
- Generate a daily pipeline summary report
本技能可将Gmail收件箱转化为结构化的销售管道。它使用Claude的MCP Connectors——具体为Gmail连接器(2026年2月推出)和Supabase连接器——来读取邮件、处理线索并持久化数据,无需任何外部脚本或集成。
工作流程:
- 在Gmail中搜索符合线索模式的未读邮件
- 从每封邮件中提取结构化线索数据
- 根据ICP匹配度、意向信号和紧急程度为线索打分
- 为每个合格线索生成个性化回复草稿
- 将所有信息记录到Supabase CRM表中
- 生成每日管道汇总报告
Phase 1: Gmail Connection and Email Retrieval
第一阶段:Gmail连接与邮件获取
Connecting to Gmail via MCP Connector
通过MCP Connector连接Gmail
Use the Gmail MCP Connector tools to access the user's inbox. The Gmail connector is available as a first-party MCP integration in Claude Code (launched February 2026). It provides direct access to Gmail operations without OAuth setup or API key management -- the connector handles authentication through Claude's MCP Connectors infrastructure.
Available Gmail MCP Tools:
- -- Search messages with Gmail query syntax
mcp__claude_ai_Gmail__gmail_search_messages - -- Read full message content by ID
mcp__claude_ai_Gmail__gmail_read_message - -- Read an entire email thread
mcp__claude_ai_Gmail__gmail_read_thread - -- Create a draft reply
mcp__claude_ai_Gmail__gmail_create_draft - -- List existing drafts
mcp__claude_ai_Gmail__gmail_list_drafts - -- List Gmail labels
mcp__claude_ai_Gmail__gmail_list_labels - -- Get user profile info
mcp__claude_ai_Gmail__gmail_get_profile
使用Gmail MCP Connector工具访问用户的收件箱。Gmail连接器是Claude Code中的官方MCP集成(2026年2月推出)。它无需OAuth设置或API密钥管理即可直接访问Gmail操作——连接器通过Claude的MCP Connectors基础设施处理身份验证。
可用的Gmail MCP工具:
- -- 使用Gmail查询语法搜索邮件
mcp__claude_ai_Gmail__gmail_search_messages - -- 通过ID读取完整邮件内容
mcp__claude_ai_Gmail__gmail_read_message - -- 读取整个邮件线程
mcp__claude_ai_Gmail__gmail_read_thread - -- 创建回复草稿
mcp__claude_ai_Gmail__gmail_create_draft - -- 列出现有草稿
mcp__claude_ai_Gmail__gmail_list_drafts - -- 列出Gmail标签
mcp__claude_ai_Gmail__gmail_list_labels - -- 获取用户个人资料信息
mcp__claude_ai_Gmail__gmail_get_profile
Step 1: Identify Lead Emails
步骤1:识别线索邮件
Search Gmail for unread emails that match inbound lead patterns. Run multiple targeted searches to catch all lead types.
Search Queries to Execute:
Query 1 - Form Submissions:
is:unread subject:(demo OR trial OR "get started" OR "sign up" OR "contact us" OR "request info")
Query 2 - Partnership Inquiries:
is:unread subject:(partnership OR collaborate OR integration OR "work together" OR referral)
Query 3 - Direct Outreach / RFPs:
is:unread subject:(proposal OR RFP OR consulting OR engagement OR "looking for" OR "need help")
Query 4 - Warm Referrals:
is:unread subject:(introduction OR intro OR referral OR "meet" OR "connecting you")
Query 5 - Pricing/Service Inquiries:
is:unread subject:(pricing OR rates OR "how much" OR services OR scope OR availability)Time Window: By default, search the last 24 hours. If the user specifies a different window (e.g., "check the last week"), adjust the parameter accordingly.
after:Deduplication: Track message IDs across all searches. If the same message ID appears in multiple search results, process it only once. Assign it to the highest-priority lead category it matched.
在Gmail中搜索符合潜在客户模式的未读邮件。运行多个针对性搜索以覆盖所有线索类型。
需执行的搜索查询:
查询1 - 表单提交:
is:unread subject:(demo OR trial OR "get started" OR "sign up" OR "contact us" OR "request info")
查询2 - 合作咨询:
is:unread subject:(partnership OR collaborate OR integration OR "work together" OR referral)
查询3 - 直接拓展/RFP:
is:unread subject:(proposal OR RFP OR consulting OR engagement OR "looking for" OR "need help")
查询4 - 推荐线索:
is:unread subject:(introduction OR intro OR referral OR "meet" OR "connecting you")
查询5 - 价格/服务咨询:
is:unread subject:(pricing OR rates OR "how much" OR services OR scope OR availability)时间范围: 默认搜索过去24小时的邮件。如果用户指定不同范围(例如“查看过去一周”),则相应调整参数。
after:去重: 跟踪所有搜索结果中的邮件ID。如果同一邮件ID出现在多个搜索结果中,仅处理一次。将其分配到匹配的最高优先级线索类别。
Step 2: Read and Parse Each Email
步骤2:读取并解析每封邮件
For every unique lead email found, use to retrieve the full content.
mcp__claude_ai_Gmail__gmail_read_messageExtract these fields from each email:
| Field | Source | Notes |
|---|---|---|
| From header | Parse "Display Name <email>" format |
| From header | Normalize to lowercase |
| From header | Extract domain from email |
| Subject header | Original subject line |
| Date header | ISO 8601 format |
| Message body | Plain text, stripped of signatures and disclaimers |
| Gmail thread ID | For tracking conversations |
| Gmail message ID | Unique identifier |
| Message metadata | Boolean |
| CC header | List of CC'd parties (may indicate stakeholders) |
Email Parsing Rules:
- Strip signatures: Remove everything after common signature delimiters (,
--,Sent from my iPhonefollowed by name/title block)Best regards, - Strip disclaimers: Remove legal/confidentiality notices at the bottom
- Strip forwarded headers: If forwarded, extract the original sender info but note it was forwarded
- Preserve formatting intent: Keep bullet points and numbered lists as structured data
- Handle HTML: If only HTML body is available, extract meaningful text content and ignore markup
对于找到的每个唯一线索邮件,使用获取完整内容。
mcp__claude_ai_Gmail__gmail_read_message从每封邮件中提取以下字段:
| 字段 | 来源 | 说明 |
|---|---|---|
| 发件人头部 | 解析“显示名称 <邮箱>”格式 |
| 发件人头部 | 标准化为小写 |
| 发件人头部 | 从邮箱中提取域名 |
| 主题头部 | 原始主题行 |
| 日期头部 | ISO 8601格式 |
| 邮件正文 | 纯文本,去除签名和免责声明 |
| Gmail线程ID | 用于跟踪对话 |
| Gmail邮件ID | 唯一标识符 |
| 邮件元数据 | 布尔值 |
| CC头部 | 抄送方列表(可能表示利益相关者) |
邮件解析规则:
- 去除签名: 删除常见签名分隔符(、
--、Sent from my iPhone后跟姓名/职位块)之后的所有内容Best regards, - 去除免责声明: 删除底部的法律/保密通知
- 去除转发头部: 如果是转发邮件,提取原始发件人信息并注明是转发
- 保留格式意图: 将项目符号和编号列表保留为结构化数据
- 处理HTML: 如果只有HTML正文,提取有意义的文本内容并忽略标记
Phase 2: Lead Data Extraction
第二阶段:线索数据提取
Step 3: Extract Structured Lead Information
步骤3:提取结构化线索信息
For each email, extract the following lead profile. Use the email body, subject, sender info, and any contextual clues.
Lead Profile Schema:
json
{
"contact": {
"name": "string -- full name of the person reaching out",
"email": "string -- sender email address",
"phone": "string|null -- phone number if mentioned in email or signature",
"role": "string|null -- job title or role if mentioned",
"linkedin": "string|null -- LinkedIn URL if included in signature"
},
"company": {
"name": "string|null -- company name from domain, signature, or email body",
"domain": "string -- extracted from email domain",
"size_estimate": "string|null -- startup/smb/midmarket/enterprise based on clues",
"industry": "string|null -- industry if determinable from context"
},
"inquiry": {
"type": "string -- one of: demo_request, partnership, rfp, referral, pricing_inquiry, general_inquiry, support_question",
"summary": "string -- 1-2 sentence summary of what they need",
"specific_services": ["string -- list of specific services or capabilities mentioned"],
"pain_points": ["string -- specific problems or challenges mentioned"],
"timeline": "string|null -- any timeline or deadline mentioned",
"budget_signals": "string|null -- any budget or pricing context mentioned"
},
"metadata": {
"source": "string -- gmail",
"source_detail": "string -- which search query matched",
"message_id": "string",
"thread_id": "string",
"received_date": "string -- ISO 8601",
"forwarded_by": "string|null -- if this was a forwarded intro",
"cc_stakeholders": ["string -- CC'd email addresses that may be stakeholders"]
}
}Extraction Guidelines:
- Company name: First check the email domain (ignore generic domains like gmail.com, yahoo.com, outlook.com, hotmail.com). Then check the email signature. Then check the body text.
- Role/Title: Look in the email signature block first. Then check if they mention their role in the body ("I'm the CTO at..." or "As head of marketing...").
- Company size: Infer from signals: domain recognition, language used ("our team of 5" vs "our enterprise"), email signature complexity, presence of standardized disclaimers.
- Industry: Infer from company name, domain, services mentioned, or explicit industry references.
- Timeline: Look for explicit dates, relative time references ("next quarter", "by end of month", "ASAP", "exploring for 2026"), or urgency language.
- Budget signals: Look for references to budget, pricing expectations, "allocated budget", "looking to spend", or comparison to existing vendor costs.
对于每封邮件,提取以下线索资料。使用邮件正文、主题、发件人信息和任何上下文线索。
线索资料架构:
json
{
"contact": {
"name": "string -- 联系人全名",
"email": "string -- 发件人邮箱地址",
"phone": "string|null -- 邮件或签名中提到的电话号码",
"role": "string|null -- 提到的职位或角色",
"linkedin": "string|null -- 签名中包含的LinkedIn链接"
},
"company": {
"name": "string|null -- 从域名、签名或邮件正文中获取的公司名称",
"domain": "string -- 从邮箱域名中提取",
"size_estimate": "string|null -- 根据线索推断的规模:startup/smb/midmarket/enterprise",
"industry": "string|null -- 根据上下文可确定的行业"
},
"inquiry": {
"type": "string -- 类型包括:demo_request, partnership, rfp, referral, pricing_inquiry, general_inquiry, support_question",
"summary": "string -- 1-2句话总结他们的需求",
"specific_services": ["string -- 提到的具体服务或能力列表"],
"pain_points": ["string -- 提到的具体问题或挑战列表"],
"timeline": "string|null -- 提到的任何时间线或截止日期",
"budget_signals": "string|null -- 提到的任何预算或定价相关内容"
},
"metadata": {
"source": "string -- gmail",
"source_detail": "string -- 匹配的搜索查询",
"message_id": "string",
"thread_id": "string",
"received_date": "string -- ISO 8601格式",
"forwarded_by": "string|null -- 如果是转发介绍",
"cc_stakeholders": ["string -- 抄送的可能是利益相关者的邮箱地址"]
}
}提取指南:
- 公司名称: 首先检查邮箱域名(忽略gmail.com、yahoo.com、outlook.com、hotmail.com等通用域名)。然后检查邮件签名。最后检查邮件正文。
- 职位/头衔: 首先查看邮件签名块。然后检查他们是否在正文中提到自己的职位(例如“我是...的CTO”或“作为营销主管...”)。
- 公司规模: 根据信号推断:域名识别、使用的语言(“我们5人团队” vs “我们企业”)、邮件签名复杂度、是否有标准化免责声明。
- 行业: 根据公司名称、域名、提到的服务或明确的行业参考推断。
- 时间线: 查找明确的日期、相对时间参考(“下个季度”、“月底前”、“ASAP”、“为2026年探索”)或紧急性语言。
- 预算信号: 查找预算、定价预期、“已分配预算”、“计划花费”或与现有供应商成本比较的相关内容。
Handling Ambiguous or Incomplete Data
处理模糊或不完整数据
When data cannot be extracted with confidence:
- Set the field to rather than guessing
null - Add a note in the field explaining what's missing
extraction_notes - Flag the lead for manual review if critical fields (name, company, what they need) are missing
- For generic email domains (gmail, yahoo, etc.), flag that company identification requires manual lookup
当无法自信地提取数据时:
- 将字段设置为而非猜测
null - 在字段中添加注释说明缺失内容
extraction_notes - 如果关键字段(姓名、公司、需求)缺失,标记线索以便人工审核
- 对于通用邮箱域名(gmail、yahoo等),标记需要人工查找公司信息
Phase 3: Lead Scoring
第三阶段:线索打分
Step 4: Score Each Lead
步骤4:为每个线索打分
Apply a multi-dimensional scoring model to each lead. The total score determines qualification status and priority.
Scoring Dimensions:
应用多维评分模型为每个线索打分。总分决定资格状态和优先级。
评分维度:
A. ICP Fit Score (0-40 points)
A. ICP匹配度得分(0-40分)
The Ideal Customer Profile score measures how well the lead matches the firm's target customer.
Company Size Alignment:
Enterprise (1000+ employees) = 15 points
Mid-market (100-999 employees) = 12 points
SMB (10-99 employees) = 8 points
Startup/Micro (1-9 employees) = 4 points
Unknown = 5 points (neutral)
Industry Alignment (configure per firm):
Primary target industries = 15 points
Secondary/adjacent industries = 10 points
Neutral industries = 5 points
Misaligned industries = 2 points
Unknown = 5 points (neutral)
Role/Authority:
C-suite, VP, Director (decision maker) = 10 points
Manager, Head of (influencer) = 7 points
Individual contributor = 4 points
Unknown role = 3 pointsDefault Target Industries for Consulting Firm:
- Primary: Technology, SaaS, Financial Services, Healthcare Tech, Professional Services
- Secondary: E-commerce, Manufacturing, Education, Real Estate Tech, Media
The user can customize these by providing their ICP definition. Ask on first run if no ICP config exists.
理想客户画像得分衡量线索与公司目标客户的匹配程度。
公司规模匹配:
企业(1000+员工) = 15分
中型市场(100-999员工) = 12分
中小企业(10-99员工) = 8分
初创/微型企业(1-9员工) = 4分
未知 = 5分(中性)
行业匹配(可根据公司配置):
主要目标行业 = 15分
次要/相邻行业 = 10分
中性行业 = 5分
不匹配行业 = 2分
未知 = 5分(中性)
职位/权限:
C-suite、VP、总监(决策者) = 10分
经理、主管(影响者) = 7分
个人贡献者 = 4分
未知职位 = 3分咨询公司默认目标行业:
- 主要:科技、SaaS、金融服务、医疗科技、专业服务
- 次要:电商、制造、教育、房地产科技、媒体
用户可通过提供ICP定义自定义这些设置。如果没有ICP配置,首次运行时询问用户。
B. Intent Score (0-35 points)
B. 意向得分(0-35分)
Measures the strength of buying intent based on language analysis.
Inquiry Type:
RFP / Formal proposal request = 12 points
Demo / Trial request = 10 points
Pricing inquiry = 9 points
Referral / Introduction = 8 points
Partnership inquiry = 6 points
General inquiry = 4 points
Support question (not a lead) = 0 points
Language Signals (cumulative, max 15 points):
Mentions specific services by name = +4
Describes a concrete problem/pain point = +4
Asks about process, timeline, or next steps = +3
References competitor or current vendor = +3
Mentions team/stakeholder involvement = +2
Uses vague/exploratory language only = +1
Engagement Depth:
Long, detailed email (200+ words) = 8 points
Medium email (50-200 words) = 5 points
Short email (under 50 words) = 2 points基于语言分析衡量购买意向的强度。
咨询类型:
RFP / 正式提案请求 = 12分
演示 / 试用请求 = 10分
价格咨询 = 9分
推荐 / 介绍 = 8分
合作咨询 = 6分
一般咨询 = 4分
支持问题(非线索) = 0分
语言信号(累计,最高15分):
提到具体服务名称 = +4
描述具体问题/痛点 = +4
询问流程、时间线或下一步 = +3
提及竞争对手或现有供应商 = +3
提到团队/利益相关者参与 = +2
仅使用模糊/探索性语言 = +1
参与深度:
长篇详细邮件(200+词) = 8分
中等长度邮件(50-200词) = 5分
短篇邮件(50词以下) = 2分C. Urgency Score (0-25 points)
C. 紧急程度得分(0-25分)
Measures how time-sensitive the opportunity is.
Explicit Timeline:
Deadline within 2 weeks = 12 points
Deadline within 1 month = 9 points
Deadline within 1 quarter = 6 points
Vague future timeline = 3 points
No timeline mentioned = 1 point
Urgency Language (cumulative, max 8 points):
"ASAP" / "urgent" / "immediately" = +4
"This week" / "this month" = +3
"Soon" / "in the near future" = +2
"Exploring" / "researching" = +1
Contextual Urgency (max 5 points):
Regulatory deadline mentioned = +5
Board/executive mandate = +4
Competitive pressure = +3
Budget expiring = +5
Seasonal/event driven = +3衡量机会的时间敏感性。
明确时间线:
2周内截止 = 12分
1个月内截止 = 9分
1季度内截止 = 6分
模糊未来时间线 = 3分
未提及时间线 = 1分
紧急性语言(累计,最高8分):
"ASAP" / "紧急" / "立即" = +4
"本周" / "本月" = +3
"很快" / "近期" = +2
"探索中" / "研究中" = +1
上下文紧急性(最高5分):
提到监管截止日期 = +5
董事会/高管指令 = +4
竞争压力 = +3
预算即将到期 = +5
季节性/事件驱动 = +3Score Interpretation and Qualification
得分解读与资格审核
Total Score Range: 0-100 points
HOT LEAD (75-100):
- Qualification: Sales-Qualified Lead (SQL)
- Action: Respond within 2 hours, book a call
- Priority: P1 -- immediate attention
- Draft: Eager, specific, offer calendar link
WARM LEAD (50-74):
- Qualification: Marketing-Qualified Lead (MQL)
- Action: Respond within 24 hours, ask qualifying questions
- Priority: P2 -- same-day response
- Draft: Warm, curious, ask 2-3 discovery questions
COOL LEAD (25-49):
- Qualification: Information-Qualified Lead (IQL)
- Action: Respond within 48 hours, nurture
- Priority: P3 -- respond when time allows
- Draft: Helpful, educational, offer resources
COLD / NOT A LEAD (0-24):
- Qualification: Unqualified
- Action: Polite response or no action
- Priority: P4 -- low priority
- Draft: Brief acknowledgment, redirect if needed总分范围:0-100分
高优先级线索(75-100):
- 资格:销售合格线索(SQL)
- 行动:2小时内回复,预约通话
- 优先级:P1 -- 立即处理
- 草稿:热情、具体,提供日历链接
中优先级线索(50-74):
- 资格:营销合格线索(MQL)
- 行动:24小时内回复,询问资格问题
- 优先级:P2 -- 当日回复
- 草稿:热情、好奇,提出2-3个探索性问题
低优先级线索(25-49):
- 资格:信息合格线索(IQL)
- 行动:48小时内回复,培育线索
- 优先级:P3 -- 有空时回复
- 草稿:有帮助、具教育性,提供资源
无效/非线索(0-24):
- 资格:不合格
- 行动:礼貌回复或不处理
- 优先级:P4 -- 低优先级
- 草稿:简短确认,必要时引导至其他渠道Score Adjustment Rules
得分调整规则
Apply these modifiers after initial scoring:
- Referral Bonus: If the email is a warm introduction from a known contact, add +10 points
- Multi-stakeholder Bonus: If multiple people are CC'd from the same company, add +5 points
- Repeat Inquiry Bonus: If this person/company has emailed before (check CRM), add +8 points
- Generic Domain Penalty: If sender uses gmail/yahoo/outlook AND no company identified, subtract -5 points
- Auto-generated Penalty: If email appears to be auto-generated (newsletter, notification), subtract -15 points
- Spam Signals Penalty: If email contains spam signals (ALL CAPS subject, excessive exclamation marks, too-good-to-be-true language), subtract -20 points
初始打分后应用以下修正:
- 推荐奖励: 如果邮件是来自已知联系人的热情介绍,加10分
- 多利益相关者奖励: 如果同一公司多人被抄送,加5分
- 重复咨询奖励: 如果此人/公司之前发过邮件(检查CRM),加8分
- 通用域名惩罚: 如果发件人使用gmail/yahoo/outlook且未识别到公司,减5分
- 自动生成邮件惩罚: 如果邮件看起来是自动生成的(通讯、通知),减15分
- 垃圾邮件信号惩罚: 如果邮件包含垃圾邮件信号(全大写主题、过多感叹号、难以置信的语言),减20分
Phase 4: Response Drafting
第四阶段:回复草稿生成
Step 5: Draft Personalized Responses
步骤5:生成个性化回复
For each qualified lead (score >= 25), draft a personalized email response. The tone should be warm, helpful, and consultative -- never salesy or pushy.
Response Framework by Lead Tier:
对于每个合格线索(得分≥25),生成个性化邮件回复。语气应热情、有帮助且具咨询性——绝不能过于销售导向或强硬。
按线索层级划分的回复框架:
HOT Lead Response Template (75-100 points)
高优先级线索回复模板(75-100分)
Objective: Get a call booked within 48 hours
Tone: Enthusiastic but professional, specific and knowledgeable
Length: 150-200 words
Structure:
1. Acknowledge their specific need (reference their exact words)
2. Brief credibility statement (1 sentence, relevant to their ask)
3. Confirm you can help with [specific thing they mentioned]
4. Propose 2-3 specific meeting times this week
5. Warm sign-offExample HOT Response Pattern:
Subject: Re: [Original Subject]
Hi [First Name],
Thanks for reaching out about [specific need they mentioned]. This is exactly
the kind of [project/challenge/initiative] we specialize in.
[One sentence of relevant credibility -- e.g., "We recently helped a similar
[industry] company [achieve specific result]."]
I'd love to learn more about [specific detail from their email] and discuss
how we might be able to help. Would any of these work for a quick intro call?
- [Day], [Time] [Timezone]
- [Day], [Time] [Timezone]
- [Day], [Time] [Timezone]
Or feel free to grab a time that works for you: [calendar link placeholder]
Looking forward to connecting.
Best,
[User's name]目标:48小时内预约通话
语气:热情但专业,具体且有见识
长度:150-200词
结构:
1. 确认他们的具体需求(引用他们的原话)
2. 简短的可信度声明(1句话,与他们的需求相关)
3. 确认您可以帮助解决[他们提到的具体问题]
4. 提出本周2-3个具体的会议时间
5. 热情的结束语高优先级回复示例模式:
主题:Re: [原始主题]
您好[名字],
感谢您联系我们咨询[他们提到的具体需求]。这正是我们擅长的[项目/挑战/举措]类型。
[一句相关的可信度说明——例如:“我们最近帮助一家类似[行业]的公司[取得了具体成果]。”]
我想进一步了解[他们邮件中的具体细节],并讨论我们如何提供帮助。以下时间是否适合进行简短的介绍性通话?
- [日期],[时间] [时区]
- [日期],[时间] [时区]
- [日期],[时间] [时区]
或者您也可以选择适合您的时间:[日历链接占位符]
期待与您联系。
此致,
[用户姓名]WARM Lead Response Template (50-74 points)
中优先级线索回复模板(50-74分)
Objective: Qualify further with 2-3 discovery questions
Tone: Curious, helpful, genuinely interested
Length: 120-180 words
Structure:
1. Thank them for reaching out (reference what they mentioned)
2. Show understanding of their situation
3. Ask 2-3 specific qualifying questions
4. Offer to set up a call once you understand more
5. Warm sign-offQualifying Questions to Choose From (pick 2-3 most relevant):
- "What's driving the timeline for this?"
- "How is your team currently handling [the problem they mentioned]?"
- "Have you explored other solutions for this, or is this a new initiative?"
- "Who else on your team would be involved in evaluating this?"
- "What does success look like for this project?"
- "What's the scope you're envisioning -- are we talking about [small scope] or [large scope]?"
- "Is there a specific budget range you're working within?"
目标:通过2-3个探索性问题进一步确认资格
语气:好奇、有帮助、真诚感兴趣
长度:120-180词
结构:
1. 感谢他们联系(提及他们提到的内容)
2. 表示理解他们的处境
3. 提出2-3个具体的资格问题
4. 表示了解更多后可安排通话
5. 热情的结束语可选的资格问题(选择2-3个最相关的):
- “推动这个项目时间线的因素是什么?”
- “您的团队目前如何处理[他们提到的问题]?”
- “您是否已经探索过其他解决方案,还是这是一项新举措?”
- “团队中还有哪些人会参与评估这个项目?”
- “这个项目的成功标准是什么?”
- “您设想的范围是什么——是[小范围]还是[大范围]?”
- “您是否有具体的预算范围?”
COOL Lead Response Template (25-49 points)
低优先级线索回复模板(25-49分)
Objective: Provide value, stay top of mind, nurture
Tone: Helpful, educational, no pressure
Length: 100-150 words
Structure:
1. Thank them for their interest
2. Provide a helpful insight related to their inquiry
3. Share a relevant resource (case study, blog post, guide)
4. Leave the door open for further conversation
5. Warm sign-off目标:提供价值,保持关注度,培育线索
语气:有帮助、具教育性,无压力
长度:100-150词
结构:
1. 感谢他们的关注
2. 提供与他们咨询相关的有用见解
3. 分享相关资源(案例研究、博客文章、指南)
4. 为进一步对话留有余地
5. 热情的结束语Response Personalization Rules
回复个性化规则
Every drafted response MUST include:
- Use their first name -- never "Dear Sir/Madam" or "To Whom It May Concern"
- Reference their specific ask -- pull exact phrases or concepts from their email
- Match their energy -- if they wrote casually, respond casually; if formal, be formal
- Acknowledge their company -- mention their company by name if known
- No jargon dumping -- don't list services; speak to their problem
- No attachments -- keep it conversational, save collateral for follow-up
- Clear next step -- every response must have ONE clear call to action
每个生成的回复必须包含:
- 使用他们的名字 —— 绝不要用“尊敬的先生/女士”或“致相关人士”
- 提及他们的具体需求 —— 从他们的邮件中提取确切短语或概念
- 匹配他们的语气 —— 如果他们写得随意,回复也随意;如果正式,就保持正式
- 提及他们的公司 —— 如果知道,就提到公司名称
- 不要堆砌术语 —— 不要罗列服务;针对他们的问题发言
- 不要添加附件 —— 保持对话性,后续再提供宣传材料
- 明确的下一步 —— 每个回复必须有一个明确的行动号召
Response Anti-Patterns (NEVER Do These)
回复禁忌(绝对不要做)
- Do NOT start with "I hope this email finds you well"
- Do NOT use "per my last email" or "as per your request"
- Do NOT include a full company capabilities overview
- Do NOT mention pricing in the first response (unless they asked specifically)
- Do NOT use buzzwords like "synergy," "leverage," "circle back," "touch base"
- Do NOT write more than 200 words for any initial response
- Do NOT use exclamation marks more than once
- Do NOT be presumptuous about their budget or timeline
- 不要以“希望您一切安好”开头
- 不要使用“根据我上一封邮件”或“按照您的要求”
- 不要包含完整的公司能力概述
- 首次回复中不要提及价格(除非他们明确询问)
- 不要使用“协同”、“利用”、“后续跟进”、“联系”等流行语
- 任何初始回复不要超过200词
- 感叹号使用不要超过一次
- 不要假设他们的预算或时间线
Creating the Draft in Gmail
在Gmail中创建草稿
After composing the response, use to save it as a draft in the user's Gmail. The draft should:
mcp__claude_ai_Gmail__gmail_create_draft- Be set as a reply to the original message (use the thread_id)
- Include the original subject with "Re:" prefix
- NOT be sent automatically -- always save as draft for user review
CRITICAL: Never auto-send emails. Always create drafts for the user to review and send manually.
撰写回复后,使用将其保存为用户Gmail中的草稿。草稿应:
mcp__claude_ai_Gmail__gmail_create_draft- 设置为回复原始邮件(使用thread_id)
- 包含原始主题并添加“Re:”前缀
- 不要自动发送 —— 始终保存为草稿供用户审核
重要提示:永远不要自动发送邮件。始终创建草稿供用户审核并手动发送。
Phase 5: CRM Logging
第五阶段:CRM记录
Step 6: Log to Supabase CRM
步骤6:记录到Supabase CRM
Use the Supabase MCP Connector to log all lead data to the CRM database.
Available Supabase MCP Tools:
- -- Execute SQL queries
mcp__claude_ai_Supabase__execute_sql - -- List existing tables
mcp__claude_ai_Supabase__list_tables - -- Apply schema migrations
mcp__claude_ai_Supabase__apply_migration - -- List Supabase projects
mcp__claude_ai_Supabase__list_projects
使用Supabase MCP Connector将所有线索数据记录到CRM数据库中。
可用的Supabase MCP工具:
- —— 执行SQL查询
mcp__claude_ai_Supabase__execute_sql - —— 列出现有表
mcp__claude_ai_Supabase__list_tables - —— 应用架构迁移
mcp__claude_ai_Supabase__apply_migration - —— 列出Supabase项目
mcp__claude_ai_Supabase__list_projects
Database Schema
数据库架构
On first run, check if the required tables exist. If not, create them with .
mcp__claude_ai_Supabase__apply_migrationTable:
leadssql
CREATE TABLE IF NOT EXISTS leads (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now(),
-- Contact info
contact_name TEXT NOT NULL,
contact_email TEXT NOT NULL,
contact_phone TEXT,
contact_role TEXT,
contact_linkedin TEXT,
-- Company info
company_name TEXT,
company_domain TEXT,
company_size TEXT CHECK (company_size IN ('startup', 'smb', 'midmarket', 'enterprise', 'unknown')),
company_industry TEXT,
-- Inquiry details
inquiry_type TEXT NOT NULL CHECK (inquiry_type IN (
'demo_request', 'partnership', 'rfp', 'referral',
'pricing_inquiry', 'general_inquiry', 'support_question'
)),
inquiry_summary TEXT NOT NULL,
specific_services TEXT[],
pain_points TEXT[],
timeline TEXT,
budget_signals TEXT,
-- Scoring
score_total INTEGER NOT NULL DEFAULT 0,
score_icp INTEGER NOT NULL DEFAULT 0,
score_intent INTEGER NOT NULL DEFAULT 0,
score_urgency INTEGER NOT NULL DEFAULT 0,
qualification TEXT NOT NULL CHECK (qualification IN ('sql', 'mql', 'iql', 'unqualified')),
priority TEXT NOT NULL CHECK (priority IN ('P1', 'P2', 'P3', 'P4')),
score_adjustments JSONB DEFAULT '[]'::jsonb,
-- Source tracking
source TEXT NOT NULL DEFAULT 'gmail',
source_detail TEXT,
gmail_message_id TEXT UNIQUE,
gmail_thread_id TEXT,
received_date TIMESTAMPTZ,
forwarded_by TEXT,
-- Response tracking
response_drafted BOOLEAN DEFAULT false,
response_draft_id TEXT,
response_draft_text TEXT,
response_sent BOOLEAN DEFAULT false,
response_sent_date TIMESTAMPTZ,
-- Pipeline tracking
stage TEXT NOT NULL DEFAULT 'new' CHECK (stage IN (
'new', 'contacted', 'qualifying', 'proposal', 'negotiation', 'won', 'lost', 'nurture'
)),
next_action TEXT,
next_action_date TIMESTAMPTZ,
assigned_to TEXT,
notes TEXT,
tags TEXT[]
);
-- Indexes for common queries
CREATE INDEX IF NOT EXISTS idx_leads_email ON leads(contact_email);
CREATE INDEX IF NOT EXISTS idx_leads_company ON leads(company_domain);
CREATE INDEX IF NOT EXISTS idx_leads_score ON leads(score_total DESC);
CREATE INDEX IF NOT EXISTS idx_leads_stage ON leads(stage);
CREATE INDEX IF NOT EXISTS idx_leads_created ON leads(created_at DESC);
CREATE INDEX IF NOT EXISTS idx_leads_qualification ON leads(qualification);
CREATE INDEX IF NOT EXISTS idx_leads_gmail_msg ON leads(gmail_message_id);Table:
lead_activity_logsql
CREATE TABLE IF NOT EXISTS lead_activity_log (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
lead_id UUID NOT NULL REFERENCES leads(id) ON DELETE CASCADE,
created_at TIMESTAMPTZ DEFAULT now(),
activity_type TEXT NOT NULL CHECK (activity_type IN (
'email_received', 'email_drafted', 'email_sent',
'score_updated', 'stage_changed', 'note_added',
'call_scheduled', 'call_completed', 'meeting_booked',
'proposal_sent', 'follow_up_scheduled'
)),
description TEXT NOT NULL,
metadata JSONB DEFAULT '{}'::jsonb
);
CREATE INDEX IF NOT EXISTS idx_activity_lead ON lead_activity_log(lead_id);
CREATE INDEX IF NOT EXISTS idx_activity_type ON lead_activity_log(activity_type);
CREATE INDEX IF NOT EXISTS idx_activity_created ON lead_activity_log(created_at DESC);Table:
pipeline_configsql
CREATE TABLE IF NOT EXISTS pipeline_config (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
config_key TEXT UNIQUE NOT NULL,
config_value JSONB NOT NULL,
updated_at TIMESTAMPTZ DEFAULT now()
);
-- Default ICP configuration
INSERT INTO pipeline_config (config_key, config_value) VALUES
('icp_primary_industries', '["Technology", "SaaS", "Financial Services", "Healthcare Tech", "Professional Services"]'::jsonb),
('icp_secondary_industries', '["E-commerce", "Manufacturing", "Education", "Real Estate Tech", "Media"]'::jsonb),
('icp_target_company_sizes', '["midmarket", "enterprise"]'::jsonb),
('icp_target_roles', '["C-suite", "VP", "Director", "Head of"]'::jsonb),
('response_calendar_link', '"https://calendly.com/PLACEHOLDER"'::jsonb),
('response_sender_name', '"PLACEHOLDER"'::jsonb),
('daily_report_recipients', '[]'::jsonb)
ON CONFLICT (config_key) DO NOTHING;首次运行时,检查所需表是否存在。如果不存在,使用创建它们。
mcp__claude_ai_Supabase__apply_migration表:
leadssql
CREATE TABLE IF NOT EXISTS leads (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
created_at TIMESTAMPTZ DEFAULT now(),
updated_at TIMESTAMPTZ DEFAULT now(),
-- 联系信息
contact_name TEXT NOT NULL,
contact_email TEXT NOT NULL,
contact_phone TEXT,
contact_role TEXT,
contact_linkedin TEXT,
-- 公司信息
company_name TEXT,
company_domain TEXT,
company_size TEXT CHECK (company_size IN ('startup', 'smb', 'midmarket', 'enterprise', 'unknown')),
company_industry TEXT,
-- 咨询详情
inquiry_type TEXT NOT NULL CHECK (inquiry_type IN (
'demo_request', 'partnership', 'rfp', 'referral',
'pricing_inquiry', 'general_inquiry', 'support_question'
)),
inquiry_summary TEXT NOT NULL,
specific_services TEXT[],
pain_points TEXT[],
timeline TEXT,
budget_signals TEXT,
-- 评分
score_total INTEGER NOT NULL DEFAULT 0,
score_icp INTEGER NOT NULL DEFAULT 0,
score_intent INTEGER NOT NULL DEFAULT 0,
score_urgency INTEGER NOT NULL DEFAULT 0,
qualification TEXT NOT NULL CHECK (qualification IN ('sql', 'mql', 'iql', 'unqualified')),
priority TEXT NOT NULL CHECK (priority IN ('P1', 'P2', 'P3', 'P4')),
score_adjustments JSONB DEFAULT '[]'::jsonb,
-- 来源跟踪
source TEXT NOT NULL DEFAULT 'gmail',
source_detail TEXT,
gmail_message_id TEXT UNIQUE,
gmail_thread_id TEXT,
received_date TIMESTAMPTZ,
forwarded_by TEXT,
-- 回复跟踪
response_drafted BOOLEAN DEFAULT false,
response_draft_id TEXT,
response_draft_text TEXT,
response_sent BOOLEAN DEFAULT false,
response_sent_date TIMESTAMPTZ,
-- 管道跟踪
stage TEXT NOT NULL DEFAULT 'new' CHECK (stage IN (
'new', 'contacted', 'qualifying', 'proposal', 'negotiation', 'won', 'lost', 'nurture'
)),
next_action TEXT,
next_action_date TIMESTAMPTZ,
assigned_to TEXT,
notes TEXT,
tags TEXT[]
);
-- 常用查询索引
CREATE INDEX IF NOT EXISTS idx_leads_email ON leads(contact_email);
CREATE INDEX IF NOT EXISTS idx_leads_company ON leads(company_domain);
CREATE INDEX IF NOT EXISTS idx_leads_score ON leads(score_total DESC);
CREATE INDEX IF NOT EXISTS idx_leads_stage ON leads(stage);
CREATE INDEX IF NOT EXISTS idx_leads_created ON leads(created_at DESC);
CREATE INDEX IF NOT EXISTS idx_leads_qualification ON leads(qualification);
CREATE INDEX IF NOT EXISTS idx_leads_gmail_msg ON leads(gmail_message_id);表:
lead_activity_logsql
CREATE TABLE IF NOT EXISTS lead_activity_log (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
lead_id UUID NOT NULL REFERENCES leads(id) ON DELETE CASCADE,
created_at TIMESTAMPTZ DEFAULT now(),
activity_type TEXT NOT NULL CHECK (activity_type IN (
'email_received', 'email_drafted', 'email_sent',
'score_updated', 'stage_changed', 'note_added',
'call_scheduled', 'call_completed', 'meeting_booked',
'proposal_sent', 'follow_up_scheduled'
)),
description TEXT NOT NULL,
metadata JSONB DEFAULT '{}'::jsonb
);
CREATE INDEX IF NOT EXISTS idx_activity_lead ON lead_activity_log(lead_id);
CREATE INDEX IF NOT EXISTS idx_activity_type ON lead_activity_log(activity_type);
CREATE INDEX IF NOT EXISTS idx_activity_created ON lead_activity_log(created_at DESC);表:
pipeline_configsql
CREATE TABLE IF NOT EXISTS pipeline_config (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
config_key TEXT UNIQUE NOT NULL,
config_value JSONB NOT NULL,
updated_at TIMESTAMPTZ DEFAULT now()
);
-- 默认ICP配置
INSERT INTO pipeline_config (config_key, config_value) VALUES
('icp_primary_industries', '["Technology", "SaaS", "Financial Services", "Healthcare Tech", "Professional Services"]'::jsonb),
('icp_secondary_industries', '["E-commerce", "Manufacturing", "Education", "Real Estate Tech", "Media"]'::jsonb),
('icp_target_company_sizes', '["midmarket", "enterprise"]'::jsonb),
('icp_target_roles', '["C-suite", "VP", "Director", "Head of"]'::jsonb),
('response_calendar_link', '"https://calendly.com/PLACEHOLDER"'::jsonb),
('response_sender_name', '"PLACEHOLDER"'::jsonb),
('daily_report_recipients', '[]'::jsonb)
ON CONFLICT (config_key) DO NOTHING;Logging Procedure
记录流程
For each processed lead, execute these steps in order:
Step 6a: Check for Duplicates
sql
SELECT id, score_total, stage FROM leads
WHERE gmail_message_id = '[message_id]'
OR (contact_email = '[email]' AND company_domain = '[domain]' AND created_at > now() - interval '30 days')
LIMIT 1;If a duplicate is found:
- If same : Skip (already processed)
gmail_message_id - If same contact + company within 30 days: Update existing lead with new interaction, log to , and apply the Repeat Inquiry Bonus (+8 points)
lead_activity_log
Step 6b: Insert New Lead
sql
INSERT INTO leads (
contact_name, contact_email, contact_phone, contact_role, contact_linkedin,
company_name, company_domain, company_size, company_industry,
inquiry_type, inquiry_summary, specific_services, pain_points, timeline, budget_signals,
score_total, score_icp, score_intent, score_urgency, qualification, priority,
score_adjustments,
source, source_detail, gmail_message_id, gmail_thread_id, received_date, forwarded_by,
response_drafted, response_draft_text, next_action, next_action_date
) VALUES (
-- [extracted values from lead profile]
);Step 6c: Log Activity
sql
INSERT INTO lead_activity_log (lead_id, activity_type, description, metadata)
VALUES (
'[new_lead_id]',
'email_received',
'Inbound [inquiry_type] from [contact_name] at [company_name]',
'{"subject": "[subject]", "score": [score], "qualification": "[qual]"}'::jsonb
);If a draft was created:
sql
INSERT INTO lead_activity_log (lead_id, activity_type, description, metadata)
VALUES (
'[new_lead_id]',
'email_drafted',
'Auto-drafted [priority] response for review',
'{"draft_id": "[gmail_draft_id]", "template_tier": "[hot/warm/cool]"}'::jsonb
);Step 6d: Set Next Action
Based on lead priority, set the appropriate next action:
P1 (HOT): next_action = "Review and send draft response"
next_action_date = now()
P2 (WARM): next_action = "Review draft, personalize, and send"
next_action_date = now() + interval '4 hours'
P3 (COOL): next_action = "Review and send nurture response"
next_action_date = now() + interval '24 hours'
P4 (COLD): next_action = "Review -- may not require response"
next_action_date = now() + interval '48 hours'对于每个处理的线索,按以下顺序执行步骤:
步骤6a:检查重复项
sql
SELECT id, score_total, stage FROM leads
WHERE gmail_message_id = '[message_id]'
OR (contact_email = '[email]' AND company_domain = '[domain]' AND created_at > now() - interval '30 days')
LIMIT 1;如果找到重复项:
- 如果是相同的:跳过(已处理)
gmail_message_id - 如果是30天内相同联系人+公司:更新现有线索的新交互,记录到,并应用重复咨询奖励(+8分)
lead_activity_log
步骤6b:插入新线索
sql
INSERT INTO leads (
contact_name, contact_email, contact_phone, contact_role, contact_linkedin,
company_name, company_domain, company_size, company_industry,
inquiry_type, inquiry_summary, specific_services, pain_points, timeline, budget_signals,
score_total, score_icp, score_intent, score_urgency, qualification, priority,
score_adjustments,
source, source_detail, gmail_message_id, gmail_thread_id, received_date, forwarded_by,
response_drafted, response_draft_text, next_action, next_action_date
) VALUES (
-- [从线索资料中提取的值]
);步骤6c:记录活动
sql
INSERT INTO lead_activity_log (lead_id, activity_type, description, metadata)
VALUES (
'[new_lead_id]',
'email_received',
'Inbound [inquiry_type] from [contact_name] at [company_name]',
'{"subject": "[subject]", "score": [score], "qualification": "[qual]"}'::jsonb
);如果创建了草稿:
sql
INSERT INTO lead_activity_log (lead_id, activity_type, description, metadata)
VALUES (
'[new_lead_id]',
'email_drafted',
'Auto-drafted [priority] response for review',
'{"draft_id": "[gmail_draft_id]", "template_tier": "[hot/warm/cool]"}'::jsonb
);步骤6d:设置下一步行动
根据线索优先级设置相应的下一步行动:
P1(高优先级): next_action = "审核并发送草稿回复"
next_action_date = now()
P2(中优先级): next_action = "审核草稿、个性化调整并发送"
next_action_date = now() + interval '4 hours'
P3(低优先级): next_action = "审核并发送培育型回复"
next_action_date = now() + interval '24 hours'
P4(无效): next_action = "审核——可能无需回复"
next_action_date = now() + interval '48 hours'Phase 6: Daily Pipeline Report
第六阶段:每日管道报告
Step 7: Generate Pipeline Report
步骤7:生成管道报告
After processing all emails, generate a comprehensive daily pipeline report and save it as a local Markdown file.
Report File: Save to the current working directory as
lead-pipeline-report.mdReport Structure:
markdown
undefined处理完所有邮件后,生成全面的每日管道报告并保存为本地Markdown文件。
报告文件: 保存到当前工作目录,命名为
lead-pipeline-report.md报告结构:
markdown
undefinedLead Pipeline Report
销售线索管道报告
Generated: [Current date and time]
Period: [Start date] to [End date]
Processed by: Gmail-to-CRM Pipeline Skill
生成时间: [当前日期和时间]
周期: [开始日期] 至 [结束日期]
处理者: Gmail转CRM管道技能
Executive Summary
执行摘要
- New leads today: [count]
- Total pipeline value: [count of active leads across all stages]
- Hot leads (P1): [count] -- RESPOND IMMEDIATELY
- Warm leads (P2): [count] -- respond today
- Cool leads (P3): [count] -- respond within 48h
- Unqualified (P4): [count]
- Average lead score: [avg] / 100
- Drafts ready for review: [count]
- 今日新增线索: [数量]
- 管道总价值: [所有阶段活跃线索数量]
- 高优先级线索(P1): [数量] -- 立即回复
- 中优先级线索(P2): [数量] -- 今日回复
- 低优先级线索(P3): [数量] -- 48小时内回复
- 不合格线索(P4): [数量]
- 平均线索得分: [平均分] / 100
- 待审核草稿: [数量]
Hot Leads -- Immediate Action Required
高优先级线索——需立即处理
1. [Contact Name] -- [Company Name] (Score: [X]/100)
1. [联系人姓名] -- [公司名称](得分:[X]/100)
- What they need: [1-sentence summary]
- Role: [Title] | Company size: [size] | Industry: [industry]
- Urgency: [timeline/urgency details]
- Key quote: "[Most important sentence from their email]"
- Draft status: Ready for review in Gmail Drafts
- Recommended action: [specific next step]
[Repeat for each hot lead]
- 需求: [1句话总结]
- 职位: [头衔] | 公司规模: [规模] | 行业: [行业]
- 紧急程度: [时间线/紧急详情]
- 关键引用: "[他们邮件中最重要的句子]"
- 草稿状态: 在Gmail草稿中待审核
- 建议行动: [具体下一步]
[为每个高优先级线索重复]
Warm Leads -- Same-Day Response
中优先级线索——当日回复
1. [Contact Name] -- [Company Name] (Score: [X]/100)
1. [联系人姓名] -- [公司名称](得分:[X]/100)
- What they need: [summary]
- Key qualifying questions to ask: [2-3 questions]
- Draft status: Ready for review
- Recommended action: [next step]
[Repeat for each warm lead]
- 需求: [总结]
- 需询问的关键资格问题: [2-3个问题]
- 草稿状态: 待审核
- 建议行动: [下一步]
[为每个中优先级线索重复]
Cool Leads -- Nurture Track
低优先级线索——培育跟踪
| # | Contact | Company | Score | Type | Next Action |
|---|---|---|---|---|---|
| 1 | [name] | [co] | [X] | [type] | [action] |
| # | 联系人 | 公司 | 得分 | 类型 | 下一步行动 |
|---|---|---|---|---|---|
| 1 | [姓名] | [公司] | [X] | [类型] | [行动] |
Unqualified / Not Leads
不合格/非线索
| # | Sender | Subject | Reason |
|---|---|---|---|
| 1 | [name] | [subj] | [why not qualified] |
| # | 发件人 | 主题 | 原因 |
|---|---|---|---|
| 1 | [姓名] | [主题] | [不合格原因] |
Pipeline Snapshot (All Active Leads)
管道快照(所有活跃线索)
| Stage | Count | Avg Score | Oldest Lead |
|---|---|---|---|
| New | [n] | [avg] | [date] |
| Contacted | [n] | [avg] | [date] |
| Qualifying | [n] | [avg] | [date] |
| Proposal | [n] | [avg] | [date] |
| Negotiation | [n] | [avg] | [date] |
Leads at risk (no activity in 7+ days):
- [Lead name] -- [company] -- last activity [date] -- [stage]
| 阶段 | 数量 | 平均得分 | 最早线索 |
|---|---|---|---|
| 新增 | [n] | [平均分] | [日期] |
| 已联系 | [n] | [平均分] | [日期] |
| 资格审核中 | [n] | [平均分] | [日期] |
| 提案中 | [n] | [平均分] | [日期] |
| 谈判中 | [n] | [平均分] | [日期] |
风险线索(7天无活动):
- [线索姓名] -- [公司] -- 最后活动日期 [日期] -- [阶段]
Score Distribution
得分分布
- 90-100: [count] leads (exceptional fit)
- 75-89: [count] leads (strong fit)
- 50-74: [count] leads (moderate fit)
- 25-49: [count] leads (low fit)
- 0-24: [count] leads (not qualified)
- 90-100:[数量]条线索(极佳匹配)
- 75-89: [数量]条线索(良好匹配)
- 50-74: [数量]条线索(中等匹配)
- 25-49: [数量]条线索(低匹配)
- 0-24: [数量]条线索(不合格)
Recommendations
建议
- [Specific actionable recommendation based on today's leads]
- [Pattern observed -- e.g., "3 leads from fintech this week -- consider targeted content"]
- [Follow-up reminder -- e.g., "2 warm leads from Monday still unanswered"]
undefined- [基于今日线索的具体可行动建议]
- [观察到的模式——例如:“本周有3条金融科技线索——考虑针对性内容”]
- [跟进提醒——例如:“周一的2条中优先级线索仍未回复”]
undefinedReport Data Sources
报告数据源
To populate the pipeline snapshot and historical data, query Supabase:
sql
-- Pipeline snapshot by stage
SELECT stage, COUNT(*) as count, AVG(score_total) as avg_score,
MIN(created_at) as oldest
FROM leads
WHERE stage NOT IN ('won', 'lost')
GROUP BY stage;
-- Leads at risk (no recent activity)
SELECT l.contact_name, l.company_name, l.stage,
MAX(a.created_at) as last_activity
FROM leads l
LEFT JOIN lead_activity_log a ON a.lead_id = l.id
WHERE l.stage NOT IN ('won', 'lost', 'nurture')
GROUP BY l.id, l.contact_name, l.company_name, l.stage
HAVING MAX(a.created_at) < now() - interval '7 days'
OR MAX(a.created_at) IS NULL;
-- Score distribution
SELECT
CASE
WHEN score_total >= 90 THEN '90-100'
WHEN score_total >= 75 THEN '75-89'
WHEN score_total >= 50 THEN '50-74'
WHEN score_total >= 25 THEN '25-49'
ELSE '0-24'
END as range,
COUNT(*) as count
FROM leads
WHERE created_at > now() - interval '30 days'
GROUP BY range
ORDER BY range DESC;为了填充管道快照和历史数据,查询Supabase:
sql
-- 按阶段划分的管道快照
SELECT stage, COUNT(*) as count, AVG(score_total) as avg_score,
MIN(created_at) as oldest
FROM leads
WHERE stage NOT IN ('won', 'lost')
GROUP BY stage;
-- 风险线索(近期无活动)
SELECT l.contact_name, l.company_name, l.stage,
MAX(a.created_at) as last_activity
FROM leads l
LEFT JOIN lead_activity_log a ON a.lead_id = l.id
WHERE l.stage NOT IN ('won', 'lost', 'nurture')
GROUP BY l.id, l.contact_name, l.company_name, l.stage
HAVING MAX(a.created_at) < now() - interval '7 days'
OR MAX(a.created_at) IS NULL;
-- 得分分布
SELECT
CASE
WHEN score_total >= 90 THEN '90-100'
WHEN score_total >= 75 THEN '75-89'
WHEN score_total >= 50 THEN '50-74'
WHEN score_total >= 25 THEN '25-49'
ELSE '0-24'
END as range,
COUNT(*) as count
FROM leads
WHERE created_at > now() - interval '30 days'
GROUP BY range
ORDER BY range DESC;Configuration and Customization
配置与自定义
First Run Setup
首次运行设置
On the very first run, the skill should:
- Check Supabase connection: Use to verify connectivity
mcp__claude_ai_Supabase__list_projects - Create tables: Run the schema migration if tables don't exist
- Seed config: Insert default ICP configuration
- Ask the user for:
- Their name (for email signatures)
- Their calendar link (for booking calls)
- Primary industries they serve
- Target company sizes
- Any custom lead source search queries
- Store config in the table
pipeline_config
首次运行时,技能应:
- 检查Supabase连接: 使用验证连接性
mcp__claude_ai_Supabase__list_projects - 创建表: 如果表不存在,运行架构迁移
- 初始化配置: 插入默认ICP配置
- 询问用户:
- 他们的姓名(用于邮件签名)
- 他们的日历链接(用于预约通话)
- 他们服务的主要行业
- 目标公司规模
- 任何自定义线索来源搜索查询
- 存储配置 在表中
pipeline_config
Customizing ICP Scoring
自定义ICP评分
Users can update their ICP at any time by saying things like:
- "We only work with enterprise companies"
- "Add healthcare to our target industries"
- "Ignore leads from education sector"
Update the table accordingly and recalculate scores for recent leads if needed.
pipeline_config用户可随时更新他们的ICP,例如:
- “我们只与企业客户合作”
- “将医疗行业添加到我们的目标行业”
- “忽略教育行业的线索”
相应更新表,并在必要时重新计算近期线索的得分。
pipeline_configAdjusting Search Queries
调整搜索查询
Users can add custom Gmail search queries:
- "Also check for emails with subject 'audit' or 'compliance'"
- "Ignore emails from recruiters"
- "Add a filter for emails mentioning 'Kubernetes'"
用户可添加自定义Gmail搜索查询:
- “同时检查主题包含'audit'或'compliance'的邮件”
- “忽略来自招聘人员的邮件”
- “添加过滤条件,包含提到'Kubernetes'的邮件”
Manual Lead Actions
手动线索操作
Support these commands when the user provides direction:
- "Mark [lead] as contacted" -- Update stage, log activity
- "Move [lead] to proposal stage" -- Update stage, prompt for proposal details
- "Disqualify [lead]" -- Set stage to 'lost', log reason
- "Add note to [lead]" -- Append to notes field, log activity
- "Schedule follow-up for [lead] on [date]" -- Update next_action_date, log activity
- "Show me all hot leads" -- Query and display P1 leads
- "What happened with [company]?" -- Show full lead history and activity log
当用户给出指示时,支持以下命令:
- “将[线索]标记为已联系” -- 更新阶段,记录活动
- “将[线索]移至提案阶段” -- 更新阶段,提示输入提案详情
- “取消[线索]资格” -- 将阶段设置为'lost',记录原因
- “为[线索]添加备注” -- 追加到notes字段,记录活动
- “为[线索]安排[日期]的跟进” -- 更新next_action_date,记录活动
- “显示所有高优先级线索” -- 查询并显示P1线索
- “[公司]的情况如何?” -- 显示完整的线索历史和活动日志
Execution Flow
执行流程
When invoked, follow this sequence:
1. CONNECT
|-- Verify Gmail MCP Connector is available
|-- Verify Supabase MCP Connector is available
|-- Check if CRM tables exist (create if first run)
|-- Load ICP config from pipeline_config table
|
2. SEARCH
|-- Execute all 5 Gmail search queries
|-- Collect unique message IDs
|-- Report: "Found [N] potential lead emails"
|
3. PROCESS (for each email)
|-- Read full message content
|-- Extract lead profile
|-- Score on ICP + Intent + Urgency
|-- Apply score adjustments
|-- Determine qualification tier
|-- Report: "[Name] from [Company] -- Score: [X] ([Tier])"
|
4. RESPOND (for qualified leads, score >= 25)
|-- Select response template based on tier
|-- Draft personalized response
|-- Create draft in Gmail (DO NOT SEND)
|-- Report: "Draft created for [Name]"
|
5. LOG
|-- Check for duplicates in Supabase
|-- Insert/update lead record
|-- Log all activities
|-- Set next actions
|-- Report: "Logged [N] leads to CRM"
|
6. REPORT
|-- Query pipeline snapshot from Supabase
|-- Generate lead-pipeline-report.md
|-- Display executive summary to user
|-- Report: "Pipeline report saved"调用时,遵循以下顺序:
1. 连接
|-- 验证Gmail MCP Connector可用
|-- 验证Supabase MCP Connector可用
|-- 检查CRM表是否存在(首次运行则创建)
|-- 从pipeline_config表加载ICP配置
|
2. 搜索
|-- 执行所有5个Gmail搜索查询
|-- 收集唯一邮件ID
|-- 报告:“找到[N]封潜在线索邮件”
|
3. 处理(每封邮件)
|-- 读取完整邮件内容
|-- 提取线索资料
|-- 根据ICP + 意向 + 紧急程度打分
|-- 应用得分调整
|-- 确定资格层级
|-- 报告:“[姓名]来自[公司] -- 得分:[X]([层级])”
|
4. 回复(合格线索,得分≥25)
|-- 根据层级选择回复模板
|-- 生成个性化回复
|-- 在Gmail中创建草稿(不要发送)
|-- 报告:“为[姓名]创建了草稿”
|
5. 记录
|-- 在Supabase中检查重复项
|-- 插入/更新线索记录
|-- 记录所有活动
|-- 设置下一步行动
|-- 报告:“已向CRM记录[N]条线索”
|
6. 报告
|-- 从Supabase查询管道快照
|-- 生成lead-pipeline-report.md
|-- 向用户显示执行摘要
|-- 报告:“管道报告已保存”Error Handling
错误处理
- Gmail connector not available: Inform the user they need to enable the Gmail MCP Connector in Claude Code settings. Provide setup instructions.
- Supabase connector not available: Offer to output lead data as local JSON/CSV files instead of database logging.
- No matching emails found: Report "No new lead emails found in the last 24 hours" and show pipeline snapshot from existing CRM data.
- Rate limiting: If Gmail API limits are hit, pause and resume. Process in batches of 10 if more than 20 emails found.
- Malformed emails: Log parsing errors, skip the email, and flag it for manual review in the report.
- Duplicate detection failure: Default to creating a new lead record with a note about potential duplicate.
- Gmail连接器不可用: 告知用户需要在Claude Code设置中启用Gmail MCP Connector。提供设置说明。
- Supabase连接器不可用: 提供将线索数据输出为本地JSON/CSV文件的替代方案,而非数据库记录。
- 未找到匹配邮件: 报告“过去24小时内未找到新的线索邮件”,并显示现有CRM数据中的管道快照。
- 速率限制: 如果达到Gmail API限制,暂停并恢复。如果找到超过20封邮件,分批处理,每批10封。
- 格式错误的邮件: 记录解析错误,跳过该邮件,并在报告中标记以便人工审核。
- 重复检测失败: 默认创建新的线索记录,并添加关于潜在重复的备注。
Privacy and Security
隐私与安全
- Never log email passwords or auth tokens in any output
- Never include full email bodies in the pipeline report -- only summaries and key quotes
- Draft responses stay as drafts -- never auto-send
- Supabase connection uses the MCP Connector's managed auth -- no raw credentials in the skill
- PII handling: Lead data in Supabase should be treated as confidential; do not include in any files shared externally
- Email content: Do not store raw email HTML/body in Supabase; store only extracted structured data and summaries
- 永远不要记录邮箱密码或认证令牌 在任何输出中
- 永远不要在管道报告中包含完整邮件正文 -- 仅包含摘要和关键引用
- 回复草稿保持为草稿 -- 永远不要自动发送
- Supabase连接 使用MCP Connector的托管认证 -- 技能中不包含原始凭证
- PII处理: Supabase中的线索数据应视为机密;不要包含在任何外部共享文件中
- 邮件内容: 不要在Supabase中存储原始邮件HTML/正文;仅存储提取的结构化数据和摘要
Quick Reference
快速参考
Invoke this skill when the user says things like:
- "Check my email for leads"
- "Process my inbox"
- "Run the lead pipeline"
- "Any new leads today?"
- "Check Gmail for demo requests"
- "Score my inbound leads"
- "Draft responses to new leads"
- "Generate a pipeline report"
- "How's my pipeline looking?"
This skill combines:
- Gmail MCP Connector (read, search, draft)
- Supabase MCP Connector (CRM storage, queries, config)
- Lead scoring algorithms (ICP, intent, urgency)
- Email copywriting (personalized, tier-appropriate responses)
- Pipeline analytics (daily reporting, risk detection)
当用户说以下内容时调用此技能:
- “检查我的邮箱中的线索”
- “处理我的收件箱”
- “运行线索管道”
- “今天有新线索吗?”
- “检查Gmail中的演示请求”
- “为我的潜在线索打分”
- “为新线索生成回复草稿”
- “生成管道报告”
- “我的管道情况如何?”
本技能结合了:
- Gmail MCP Connector(读取、搜索、草稿)
- Supabase MCP Connector(CRM存储、查询、配置)
- 线索评分算法(ICP、意向、紧急程度)
- 邮件文案撰写(个性化、分层回复)
- 管道分析(每日报告、风险检测)