customer-service
Production customer service system. Use when user wants to (1) create product/customer/operator - create records with optional --mock for auto-generation, (2) read/update/delete - manage records, (3) list - view database, (4) call - start customer service call with info verification and permission control. Supports cold-start customers. Data stored in .ezagent/database/customer_service/.
SKILL.md
| Name | customer-service |
| Description | Production customer service system. Use when user wants to (1) create product/customer/operator - create records with optional --mock for auto-generation, (2) read/update/delete - manage records, (3) list - view database, (4) call - start customer service call with info verification and permission control. Supports cold-start customers. Data stored in .ezagent/database/customer_service/. |
name: customer-service description: Production customer service system. Use when user wants to (1) create product/customer/operator - create records with optional --mock for auto-generation, (2) read/update/delete - manage records, (3) list - view database, (4) call - start customer service call with info verification and permission control. Supports cold-start customers. Data stored in .ezagent/database/customer_service/.
Customer Service System (Production)
Production-grade customer service response system with:
- Information verification: Query systems before responding
- Permission control: Actions within authority limits
- Cold-start support: Handle unknown callers, save info after call
Commands
| Command | Description |
|---|---|
create <type> | Create product/customer/operator (use --mock to auto-generate) |
read <type> | Read a specific record by name or ID |
update <type> | Update an existing record |
delete <type> | Delete a record |
list | View current database |
call | Start customer service call session |
Types: product, customer, operator
create
Create a record in the database. Use --mock flag to auto-generate realistic data.
Usage
create <type> [--mock]
create product
Required Fields (ask user if not using --mock):
- name: Product/service name
- description: What the product/service does
- features: Key features list
- common_issues: Typical problems customers encounter
- solutions: Standard resolutions for common issues
- faq: Frequently asked questions
- escalation_criteria: When to escalate to supervisor
- sla: Service level agreements
- api_interfaces: System API definitions (see below)
- operator_permissions: Permission rules (see below)
API Interface Example:
{
"user_subscription": {
"description": "查询用户订阅状态",
"endpoint": "/api/user/{user_id}/subscriptions",
"method": "GET",
"params": ["user_id"],
"response_fields": ["subscriptions", "status"],
"mock_enabled": true
}
}
Permission Rules Example:
{
"can_approve_immediately": ["退款<100元", "重置密码"],
"requires_supervisor": ["退款>=100元", "账户注销"],
"requires_process": ["投诉处理", "赔偿申请"],
"forbidden": ["透露其他用户信息"]
}
create customer
Required Fields (ask user if not using --mock):
- name: Customer name
- phone: Phone number (for lookup)
- type: Customer type (new/returning/vip)
- background: Customer background
- communication_style: How they communicate
- special_needs: Any special considerations
create operator
Required Fields (ask user if not using --mock):
- name: Strategy name
- methodology: HEAR, LAST, LEARN, or custom
- greeting: How to open the call
- discovery_questions: Questions to understand issues
- empathy_phrases: Phrases to show understanding
- resolution_steps: Problem-solving process
- objection_handling: Handling difficult situations
- closing_technique: Professional call endings
For methodology details, see references/service-methodologies.md.
--mock Flag
When --mock is specified, generate realistic data using templates from references/mock-templates.md.
For mock products, MUST include api_interfaces and operator_permissions fields.
Save Command
uv run scripts/save_record.py --type <type> --data '<json>'
read
Read a specific record by name or ID.
uv run scripts/get_record.py --type product --name '会员订阅服务'
uv run scripts/get_record.py --type customer --id 'abc123'
uv run scripts/get_record.py --type operator --name 'HEAR策略'
update
Update an existing record. Provide updates as JSON.
uv run scripts/update_record.py --type customer --name '张先生' --updates '{"phone": "13800138001"}'
uv run scripts/update_record.py --type product --name '会员订阅服务' --updates '{"sla": "24小时响应"}'
uv run scripts/update_record.py --type operator --id 'abc123' --updates '{"methodology": "LAST"}'
delete
Delete a record from the database.
uv run scripts/delete_record.py --type customer --name '张先生'
uv run scripts/delete_record.py --type product --id 'abc123'
uv run scripts/delete_record.py --type operator --name 'HEAR策略' --force
list
uv run scripts/list_records.py # All records
uv run scripts/list_records.py --type product # Products only
uv run scripts/list_records.py --verbose # Detailed view
call
Start a production customer service call session.
Step 1: Session Initialization
Required parameters from user:
- product: Product/service name
- operator: Service strategy name
- caller_phone (optional): Caller's phone number
If caller_phone provided, search for existing customer. If not found, create cold-start customer record.
If no phone provided, ask user to provide customer name OR indicate this is a new caller.
Step 2: Load Session Data
- Search for product in
.ezagent/database/customer_service/products/ - Search for operator in
.ezagent/database/customer_service/operators/ - Search/create customer:
- If phone: lookup by phone, create cold-start if not found
- If name: lookup by name
- If new caller: create cold-start record
If product or operator NOT found: Stop and report error.
Step 3: Start Call
Display session start:
--- 客服电话已接通 ---
来电号码: {phone}
产品: {product_name}
客户: {customer_name} {如果是冷启动客户: [新客户]}
策略: {operator_name}
---
You are the customer service representative. Use operator strategy to guide responses.
Step 4: Information Verification (CRITICAL)
Before responding to customer claims, ALWAYS verify first:
-
When customer mentions a service/subscription:
【系统查询 - Mock】 接口: GET /api/user/{phone}/subscriptions 目的: 确认客户是否订阅了该服务 ---Generate mock response, then respond based on result.
-
When customer disputes charges:
【系统查询 - Mock】 接口: GET /api/user/{phone}/billing?date=2026-01-25 目的: 查询账单明细 --- -
If service not found in system:
- Don't assume customer is wrong
- Ask clarifying questions: "我们系统中没有找到名为'大会员'的服务,您手机上显示的服务名称是什么?"
- Offer similar services if applicable
Step 5: Permission Control (CRITICAL)
Before agreeing to customer requests, check permissions:
When customer requests an action (refund, extension, cancellation, etc.):
-
Check against
operator_permissionsin product data -
Display permission check:
【权限检查结果】 操作: 退款50元 状态: ✓ 可立即批准 说明: 在权限范围内(退款<100元) --- -
If requires approval:
【权限检查结果】 操作: 退款200元 状态: ⚠ 需要主管审批 说明: 超出当前权限(退款>=100元) 流程: 请告知客户需要主管审批,预计2小时内回复 --- -
Respond appropriately:
- Approved: Proceed with action
- Needs supervisor: "这个需要我向主管申请,预计2小时内给您回复,可以吗?"
- Needs process: "这个需要您提交正式申请,我帮您记录工单..."
- Forbidden: "非常抱歉,这个我们无法处理,因为..."
Step 6: Conversation Guidelines
Response pattern:
- Acknowledge customer's concern
- Query relevant system (show mock block)
- Check permission if action needed (show permission block)
- Provide response based on verified information and authorized actions
Example exchange:
客户: 我没有订阅大会员,为什么扣了我15块钱!
【系统查询 - Mock】
接口: GET /api/user/138xxxx1234/subscriptions
响应: {
"subscriptions": [
{"name": "超级会员", "fee": 15.00, "start_date": "2025-12-20", "auto_renew": true}
]
}
---
客服: 我理解您的困惑。我查了一下您的账户,发现您在2025年12月20日开通了"超级会员"服务,月费15元,目前是自动续费状态。您说的"大会员"可能就是这个服务?如果您希望取消自动续费,我可以帮您处理。
Step 7: End Call and Save
When user says "结束通话", "exit", or indicates call complete:
-
Display:
--- 客服电话已结束 --- -
Collect information learned during call (for cold-start customers):
- Customer's actual name (if revealed)
- Issue type
- Communication preferences
- Any special notes
-
Build conversation array:
[ {"role": "agent", "content": "..."}, {"role": "customer", "content": "..."} ] -
Generate summary:
{ "resolution_status": "resolved|partially_resolved|unresolved", "issue_summary": "...", "actions_taken": ["..."], "follow_up_required": true/false, "customer_updates": { "name": "张先生", "communication_style": "直接简洁" } } -
Save session (includes customer info update for cold-start):
uv run .claude/skills/customer-service/scripts/save_session.py \ --claude-session "<claude_code_session_id>" \ --product "<product_name>" \ --customer "<customer_name>" \ --operator "<operator_name>" \ --review '<json_summary>' \ --conversation '<json_conversation>' \ --update-customer '<customer_updates_json>'Session ID Format:
cs_{YYYYMMDD}_{seq}_{claude_session_id}cs: customer-service 类型前缀YYYYMMDD: 日期seq: 当天序号(3位数字,如 001)claude_session_id: 当前 Claude Code 对话的 session ID
示例:
cs_20260125_001_abc123 -
Display summary to user.
Database Structure
.ezagent/database/customer_service/
├── products/
│ └── <id>_<name>/
│ ├── info.json # Includes api_interfaces, operator_permissions
│ └── README.md
├── customers/
│ └── <id>_<name>/
│ ├── info.json # Includes interaction_history
│ └── README.md
├── operators/
│ └── <id>_<name>/
│ ├── info.json
│ └── README.md
└── history/
└── cs_{YYYYMMDD}_{seq}_{claude_session_id}/
├── session.json # Includes full conversation
└── README.md
Quick Reference
Mock Data Block Format
【系统查询结果 - Mock】
接口: {METHOD} {endpoint}
响应: {json_data}
---
Permission Check Format
【权限检查结果】
操作: {action}
状态: {✓ 可立即批准 | ⚠ 需要主管审批 | ⚠ 需要走流程 | ✗ 禁止操作}
说明: {reason}
---
Service Methodologies
- HEAR: Hear → Empathize → Apologize → Resolve
- LAST: Listen → Apologize → Solve → Thank
- LEARN: Listen → Empathize → Ask → Resolve → Notify
For detailed guidance, see references/service-methodologies.md.