AI-driven e-commerce customer service robot that automatically identifies customer intent and handles scenarios such as order inquiries, product recommendations, and complaint tickets.
Trigger conditions
This skill is activated when the user says the following:
- "Customer service reply"
- "Handle customer issues"
- "Order inquiry"
- "ecommerce support"
- "Help me reply to the customer"
- "Generate customer service scripts"
Dependent MCP services
| MCP | Purpose | Required |
|---|---|---|
| playwright | Automatically log in to the e-commerce backend to query orders | Optional |
| supabase | Store order/ticket data | Optional |
| memory | Maintain conversation context | Optional |
Workflow
┌─────────────────────┐
│ 客户消息输入 │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ AI 意图识别 │
│ 分析客户需求 │
└──────────┬──────────┘
│
┌─────┼─────┬──────────┐
│ │ │ │
▼ ▼ ▼ ▼
┌───────┐┌───────┐┌───────┐┌───────┐
│订单 ││商品 ││投诉 ││常见 │
│查询 ││推荐 ││工单 ││问答 │
└───┬───┘└───┬───┘└───┬───┘└───┬───┘
│ │ │ │
▼ ▼ ▼ ▼
┌───────┐┌───────┐┌───────┐┌───────┐
│Playwright│ AI ││创建 ││知识库 │
│查后台 ││分析 ││工单 ││匹配 │
└───┬───┘└───┬───┘└───┬───┘└───┬───┘
│ │ │ │
└────────┴────────┴────────┘
│
▼
┌─────────────────┐
│ 生成客服回复 │
│ 保存对话记录 │
└─────────────────┘
Execution steps
Step 1: Receive customer message
Input format:
用户: 帮我回复这个客户:
"你好,我的订单123456怎么还没发货?已经3天了!"
Or batch processing:
用户: 处理这些客服消息 [消息列表/文件]
Step 2: AI intent recognition
Intent classification:
| Intent | Keywords | Handling method |
|---|---|---|
| Order inquiry | Order, shipment, logistics, where is it | Query order status |
| Refund and return | Refund, return, exchange, no longer want it | Create return ticket |
| Product consultation | Is it in stock, size, color, recommendation | Product recommendation |
| Complaints and suggestions | Complaint, negative review, dissatisfied, garbage | Create complaint ticket |
| Promotions | Coupon, discount, promotion, cheap | Promotion information |
| After-sales issues | Broken, quality issue, repair | Create after-sales ticket |
| Chitchat and other | Hello, thank you, are you there | General reply |
Intent recognition prompt:
分析以下客户消息的意图:
【客户消息】
{message}
【输出格式】
{
"intent": "order_query|refund|product_inquiry|complaint|promotion|after_sale|chat",
"confidence": 0.95,
"entities": {
"order_id": "123456",
"product_name": "",
"emotion": "negative|neutral|positive"
},
"urgency": "high|medium|low"
}
Step 3: Order inquiry handling
Method A: Use Playwright MCP to query real orders
Applicable scenarios: Need to query real order status in the e-commerce backend
// Playwright MCP 操作步骤
1. 打开电商后台
browser_navigate({ url: "https://seller.taobao.com" })
// 或其他电商平台后台
2. 检查登录状态
- 如未登录,提示用户先登录
- 保存登录状态供后续使用
3. 进入订单管理
browser_click({ element: "订单管理" })
4. 搜索订单号
browser_type({
element: "订单搜索框",
text: "{order_id}"
})
browser_click({ element: "搜索" })
5. 获取订单状态
browser_snapshot() // 截图获取订单信息
6. 解析订单状态
- 订单状态(待发货/已发货/已签收)
- 物流信息
- 预计到达时间
Supported e-commerce platforms:
- Taobao/Tmall Seller Center
- JD Merchant Backend
- Pinduoduo Merchant Edition
- Shopify Admin
- Youzan Merchant Backend
Method B: Simulated order data
Applicable scenarios: Demonstration or no backend access permission
{
"order_id": "123456",
"status": "shipped",
"status_text": "已发货,运输中",
"logistics": {
"company": "顺丰速运",
"tracking_no": "SF1234567890",
"last_update": "2025-12-28 15:30",
"location": "深圳转运中心"
},
"estimated_delivery": "2025-12-30"
}
Step 4: Product recommendation handling
Recommendation logic:
1. 解析客户需求(品类、价格区间、偏好)
2. 匹配商品库/搜索商品
3. 生成推荐话术
【推荐话术模板】
亲,根据您的需求,为您推荐以下商品:
1️⃣ **{商品名1}** - ¥{价格}
{商品亮点}
2️⃣ **{商品名2}** - ¥{价格}
{商品亮点}
您看哪款更合适呢?有任何问题随时问我~
Use Playwright to obtain product information
// 从电商平台获取商品详情
1. 打开商品页面
browser_navigate({ url: "{product_url}" })
2. 获取商品信息
browser_snapshot()
3. 解析信息
- 商品名称
- 价格
- 库存状态
- 规格参数
Step 5: Ticket handling
Create ticket:
{
"ticket_id": "TK20251229001",
"type": "complaint",
"customer_id": "C12345",
"order_id": "123456",
"description": "客户投诉物流慢",
"priority": "high",
"status": "open",
"created_at": "2025-12-29T10:30:00Z"
}
Ticket handling process:
- Create ticket record
- Generate reassuring reply
- Notify relevant personnel (email MCP can be used)
- Track handling progress
Step 6: Generate customer service reply
Reply generation prompt:
你是一位专业的电商客服,请根据以下信息生成回复:
【客户消息】
{customer_message}
【意图分析】
意图: {intent}
情绪: {emotion}
紧急度: {urgency}
【查询结果】
{query_result}
【回复要求】
1. 称呼亲切(亲/您好)
2. 先共情,再解决
3. 信息准确完整
4. 语气温和专业
5. 如有问题主动道歉
6. 结尾询问是否还有其他需要
【输出格式】
直接输出回复内容,可适当使用emoji
Step 7: Save conversation record
{
"conversation_id": "conv_20251229_001",
"customer_id": "C12345",
"messages": [
{
"role": "customer",
"content": "我的订单怎么还没发货?",
"timestamp": "2025-12-29T10:30:00Z"
},
{
"role": "assistant",
"content": "亲,非常抱歉让您久等了...",
"timestamp": "2025-12-29T10:30:05Z",
"intent": "order_query"
}
]
}
Customer service script template library
Order inquiry reply
Shipped:
亲,您的订单已经发货啦!🚚
物流信息:
📦 快递公司:{company}
📝 运单号:{tracking_no}
📍 当前位置:{location}
⏰ 预计送达:{estimated_delivery}
您可以点击订单详情查看实时物流~
还有其他问题吗?
Not shipped:
亲,非常抱歉让您久等了!🙏
您的订单目前正在加紧处理中,预计{ship_date}前发出。
给您带来不便深感抱歉,我们会尽快为您安排~
如果着急,我可以帮您催一下仓库哦!
Refund handling reply
亲,收到您的退款申请了~
我这边已经帮您提交处理:
📋 退款单号:{refund_id}
💰 退款金额:¥{amount}
⏰ 预计到账:1-3个工作日
退款会原路返回,届时请留意账户变动。
如有问题随时联系我哦!
Complaint appeasement reply
亲,真的非常抱歉给您带来了不好的体验!🙏
我完全理解您的心情,这确实是我们的问题。
我已经将您的情况反馈给主管,会尽快给您一个满意的解决方案。
为了表示歉意,这边给您申请了一张{coupon}优惠券,
希望能弥补一点点这次的不愉快。
请问您方便留一下联系电话吗?我们主管会亲自给您回电处理。
Product inquiry reply
亲,这款商品的详细信息如下:
📦 {product_name}
💰 价格:¥{price}
📏 规格:{specs}
🎁 赠品:{gifts}
📦 库存:{stock_status}
{product_highlights}
现在下单还有{promotion}活动哦~
需要我帮您看下尺码吗?
Usage examples
Example 1: Single message reply
用户: 帮我回复:"订单123456到哪了"
Claude:
1. 识别意图:订单查询
2. [可选] 使用Playwright查询后台订单状态
3. 生成回复:
"亲,您的订单123456已经发货啦!
快递:顺丰 SF1234567890
当前位置:深圳转运中心
预计明天送达~还有其他问题吗?"
Example 2: Batch processing
用户: 批量回复这10条客户消息
Claude:
1. 逐条分析意图
2. 批量查询相关信息
3. 生成10条回复
4. 输出结果供复制使用
Example 3: Integrate with e-commerce backend
用户: 连接淘宝后台,查询订单123456的真实状态
Claude:
1. 使用Playwright打开淘宝卖家中心
2. 检查登录状态(如需登录则提示)
3. 搜索订单号
4. 截图获取订单状态
5. 解析并生成回复
E-commerce platform backend configuration
Taobao/Tmall
platform: taobao
login_url: https://login.taobao.com
seller_url: https://myseller.taobao.com
order_path: /home.htm#/order-manage
search_selector: "#keyword"
JD merchant
platform: jd
login_url: https://passport.jd.com
seller_url: https://shop.jd.com
order_path: /order/list
search_selector: ".search-input"
Shopify
platform: shopify
login_url: https://{store}.myshopify.com/admin
order_path: /admin/orders
search_selector: "#search-query"
Data storage
- Conversation records:
~/.claude/cache/ecommerce-support/conversations/ - Ticket records:
~/.claude/cache/ecommerce-support/tickets/ - Reply templates:
~/.claude/cache/ecommerce-support/templates/
Dependency tools
- Claude AI: Intent recognition + reply generation
- playwright MCP: Query e-commerce backend orders (optional)
- memory MCP: Maintain conversation context (optional)
- Write: Save conversation records
Best practices
Improve reply quality
- Empathize first, then solve the problem
- Information must be accurate and complete
- Avoid mechanical replies
- Appropriately use emoji to increase affinity
Handle negative emotions
- Apologize immediately
- Provide a clear solution
- Appropriate compensation (coupons, etc.)
- Escalation channel (supervisor call back)
Efficiency improvement
- Build a knowledge base of common questions
- Preset reply templates
- Batch process similar issues
- Automatically classify priorities