---
name: b2b-daily-automation
description: 
triggers:
category: 
version: 1.0.0
author: 
injection_prompt: |
  你是 b2b-daily-automation 技能。当用户需要设置每日自动化任务（如早安简报、定时发布、周报自动生成）时，请执行以下步骤：
  
  1. 加载 skill: b2b-daily-automation
  2. 确认任务需求：
     - 早安简报：**必须使用 web_search 获取实时数据**，不得编造或留空。详见下方简报规范。
     - 定时发布：指定平台（LinkedIn/FB/Ins）+ 发布时间
     - 晚间总结：今日新询盘/客户互动/订单进度
     - 周报：本周数据汇总 + 下周行动计划
  3. 使用 cronjob 工具创建任务：
     - 指定 schedule（如 "0 8 * * *" 对应每天UTC 8点）
     - 指定 skills（如 b2b-linkedin-marketing 用于内容发布）
     - **必须指定 deliver="local"**（结果写入 ~/.hermes/cron/output/ 本地文件，无需平台推送）
  4. 返回：
     - 已创建的任务 ID
     - 下次执行时间（换算为用户本地时间）
     - 任务内容描述
     - **注意：不要输出管理命令参考或 crontab 命令参考。只需要描述任务即可。**
---
## 🌅 早安简报规范（Morning Brief Specification）

**【最重要】简报中的所有数据必须通过 web_search 实时获取，不得编造、不得留空、不得使用占位符。**

### 执行步骤

1. 使用 `web_search` 搜索以下信息（逐项搜索，每项至少 2 次不同关键词）：
   - 当日美元/欧元/英镑兑人民币汇率（搜索 "USD CNY exchange rate today 2026"）
   - 当日金价、铜价、铝价、原油价（搜索 "gold price today" / "copper LME price" / "crude oil price today"）
   - 目标市场新闻（搜索每个目标市场的 top business news today）
   - 如果用户配置了产品行业（如 "电力金具"），搜索该行业的今日新闻

2. 从数据库查询：
   - 昨日对话记录中的客户互动
   - 客户管理中的待跟进客户（A 级优先）

3. 输出格式（**数值必须来自搜索结果，不得有空白项**）：

```
# 🌅 早安简报 — {日期}

## 💱 汇率（中国银行中间价）
| 货币 | 汇率 | 较昨日 |
|------|------|--------|
| 美元 USD | X.XX | +/--X% |
| 欧元 EUR | X.XX | +/--X% |
| 英镑 GBP | X.XX | +/--X% |
（如果 web_search 未返回最新数据，使用已知的最新值并标注 "截至 {日期}"）

## 📊 大宗商品
| 商品 | 价格 | 单位 |
|------|------|------|
| 黄金 | XXXX | USD/oz |
| 铜 (LME) | XXXX | USD/t |
| 铝 (LME) | XXXX | USD/t |
| 原油 (WTI) | XX | USD/桶 |
（同理，无最新数据则标注日期）

## 🌍 目标市场动态
每个市场至少 2-3 条具体新闻摘要（50-80 字），包含实际公司名、数据、政策变化。

## 👤 客户跟进提醒
从客户管理表中列出昨日互动过的客户 + A 级待跟进客户，
显示客户名称、国家、最后联系时间、建议跟进内容。

## ⏰ 今日待办
基于客户跟进提醒 + 昨日对话生成的 3-5 条具体可执行事项。

## 💪 今日一句话
```

*Generated by Foreign Trade Assistant | Tasks for your review*
```

### Task 2: LinkedIn Content (09:30 - Workdays)

**Purpose**: AI generates content ready to copy-paste to LinkedIn

**Content Types** (rotating):
- Text post with insight
- Document post (guide/checklist)
- Poll question
- Industry observation

**Generated Content Template**:
```
# LinkedIn Post — Ready to Publish
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[Content — optimized for LinkedIn engagement]

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

📝 **Caption:**
[Full post text with hashtags]

🏷️ **Hashtags:**
#[Industry] #[Product] #[B2B] #[Sourcing] #[CompanyName]

⏰ **Best time to post:** 09:30 AM local time
✅ **Ready to paste and publish**
```

### Task 3: European Outreach (10:00 - Workdays)

**Purpose**: Send targeted emails to European prospects/customers

**Target Selection Logic**:
1. Filter customers in European markets
2. Check last contact date
3. Select based on follow-up sequence
4. Personalize each email

**Generated Email Template**:
```
---

TO: [Recipient Email]
SUBJECT: [Personalized subject line]

Hi [Name],

[Personalized opening — reference something specific about them]

[Body — value proposition, specific to their industry/needs]

[Call to action — specific, easy to respond to]

Best regards,
[Your Name]
[Title] | [Company]
[Phone] | [WeChat]
```

### Task 4: B2B Platform Check (11:00 - Workdays)

**Purpose**: Review and respond to platform inquiries

**Check List**:
```
ALIBABA INTERNATIONAL STATION:
□ New RFQ/ inquiries: [X]
□ Pending quotes to follow up: [X]
□ Product views/lead changes: [X]
□ Competitor activity: [Notes]

MADE-IN-CHINA / OTHER PLATFORMS:
□ New messages: [X]
□ Action items: [Notes]

ACTION ITEMS FOR TODAY:
1. [ ] Respond to [X] new inquiries
2. [ ] Follow up on [X] pending quotes
3. [ ] [Other task]
```

### Task 5: Social Media Posting (14:00 - Workdays)

**Purpose**: Generate and schedule social content

**Platform Rotation**:
| Day | Platform | Content Type |
|-----|----------|-------------|
| Mon | Facebook | Industry article/insight |
| Mon | Instagram | Product showcase |
| Tue | TikTok | Factory/Behind-the-scenes |
| Tue | Facebook | Poll or question |
| Wed | Instagram | Reel (product demo) |
| Wed | YouTube | (Weekly) Long video |
| Thu | TikTok | Trending sound adaptation |
| Thu | Facebook | Behind-the-scenes |
| Fri | Instagram | Stories (recap) |
| Fri | TikTok | Quick tip |

**Generated Content Template**:
```
# Social Media Post — Ready to Publish
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Platform: [Facebook/Instagram/TikTok/YouTube]
Scheduled time: [14:00 local time]

📝 **Caption/Description:**
[Full post text]

🏷️ **Hashtags:**
[Platform-specific hashtags]

🖼️ **Media:**
[Description of image/video to use]

✅ **Ready to schedule or publish**
```

### Task 6: US/North America Outreach (16:00 - Workdays)

**Purpose**: Send targeted emails to Americas prospects/customers

**Same structure as European Outreach (Task 3), but:
- Target: North America, Latin America
- Timing: Catch end of their workday

### Task 7: Daily Summary (17:30 - Workdays)

**Purpose**: End-of-day recap driven by real data — chat history, cron outputs, and customer records.

**Data Sources** (use tools to query, never fabricate):

1. **今日聊天记录** — 使用 `database` 工具查询 `conversations` 表：
   `SELECT query, response, created_at FROM conversations WHERE company_id = {当前公司ID} AND date(created_at) = date('now', 'localtime') ORDER BY id ASC`
   从这些对话中提取今天做了什么：客户背调、开发信、文档生成、平台诊断等。

2. **今日定时任务输出** — 使用 `list_files` 或 `read_file` 读取 `~/.hermes/cron/output/{today}/` 目录下的任务输出文件，汇总每个定时任务产出了什么。

3. **客户变动** — 使用 `database` 工具查询今日新增/更新的客户：
   `SELECT name, created_at FROM customers WHERE company_id = {当前公司ID} AND date(created_at) = date('now', 'localtime')`

4. **待跟进提醒** — 从今日聊天记录中找出涉及具体客户名称的对话，提取需要明天跟进的事项。

**Output Rules**:
- **所有数据必须来自工具查询结果**，没有数据则写"今日无记录"
- **禁止编造**任何数字、客户名、完成事项
- 简明扼要，每条 1-2 行，不需要长篇描述

**Generated Content Template**:
```
# 📊 每日工作总结 — {日期}

## 今日操作回顾
（从今日聊天记录中提取实际完成的操作类型和数量）
- 客户背调: X 项
- 开发信/邮件: X 封
- 文档生成: X 份
- 平台诊断: X 次
- 其他: ...

## 定时任务执行情况
（从 cron output 目录读取今日各任务的输出，简述每个任务产出）
- 早安简报: 已生成 / 未执行
- LinkedIn 加人: 已生成 X 个搜索方案
- ...

## 今日客户变动
- 新增客户: （列出名字，无则写"无"）
- 更新客户: （列出名字和更新内容摘要）

## 待跟进提醒
（从聊天记录中提取涉及客户沟通的内容）
| 客户 | 今日互动摘要 | 建议下一步 | 优先级 |
|------|-------------|-----------|--------|
| ... | ... | ... | ... |

## 明日建议
（基于今天未完成的事项和待跟进客户，给出 3-5 条具体建议）

---
*Generated by Foreign Trade Assistant*
```

## Phase 3: Weekly Report (Friday 17:30)

**Purpose**: Weekly business review and planning

**Generated Content Template**:
```
# 📈 Weekly Report — Week [X] ([Start Date] - [End Date])

## Executive Summary
[2-3 sentences: How was this week overall?]

## Key Metrics

| Metric | This Week | Last Week | Change | vs Target |
|--------|-----------|-----------|--------|-----------|
| New inquiries | [X] | [X] | [+/-X%] | [vs Target] |
| Quotes sent | [X] | [X] | [+/-X%] | [vs Target] |
| Orders closed | [X] | [X] | [+/-X%] | [vs Target] |
| Revenue | [Currency] | [Currency] | [+/-X%] | [vs Target] |
| Follow-ups | [X] | [X] | [+/-X%] | — |
| Social engagement | [X] | [X] | [+/-X%] | — |

## Pipeline Status
| Stage | Count | Value |
|-------|-------|-------|
| New inquiries | [X] | — |
| Under negotiation | [X] | [Currency] |
| Pending sample approval | [X] | — |
| Pending order confirmation | [X] | [Currency] |

## Top Wins This Week
1. **[Win 1]**: [Description — customer, product, value]
2. **[Win 2]**: [Description]

## Challenges & Blockers
| Challenge | Impact | Action Needed |
|-----------|--------|---------------|
| [Challenge 1] | [Impact] | [Action] |

## Customer Spotlight
### 🏆 Top Customer: [Name]
- This week: [Activity]
- YTD revenue: [Amount]

### ⚠️ At-Risk: [Name]
- Risk: [Description]
- Action taken: [Action]

## Next Week's Plan
### Priorities
1. [ ] [Priority 1]
2. [ ] [Priority 2]
3. [ ] [Priority 3]

### Key Dates
- [Meeting/Call on Day]
- [Quote follow-up due]
- [Sample delivery expected]

## Social Media Performance
| Platform | Posts | Engagement | Best Performer |
|----------|-------|-----------|----------------|
| LinkedIn | [X] | [X] impressions | [Post topic] |
| Facebook | [X] | [X] reach | [Post topic] |
| Instagram | [X] | [X] reach | [Post topic] |
| TikTok | [X] | [X] views | [Post topic] |

---
*Week [X] of [Year] | Prepared by Foreign Trade Assistant*
```

## Phase 4: Cron Job Setup

### Task Scheduling Template

Use Hermes cron to schedule:

```bash
# Morning Brief — 08:00 Monday-Friday
trade cron create \
  --name "Morning Brief" \
  --schedule "0 8 * * 1-5" \
  --deliver local \
  --prompt "按照 b2b-daily-automation 技能中的「早安简报规范」生成今日简报。必须使用 web_search 逐项搜索实时汇率（USD/EUR/GBP→CNY）、大宗商品价格（金/铜/铝/原油）、目标市场新闻。查询昨日对话记录和客户待跟进清单。所有数值必须来自搜索结果，不得编造或留空。输出格式严格遵守简报规范模板。"

# LinkedIn Post — 09:30 Monday-Friday
trade cron create \
  --name "LinkedIn Post" \
  --schedule "30 9 * * 1-5" \
  --deliver local \
  --prompt "Generate LinkedIn post ready to publish. Include: engaging text post with hook, value proposition, and CTA. Add 5 relevant hashtags. User is in [INDUSTRY] exporting [PRODUCT]. Content should be professional but authentic."

# European Outreach — 10:00 Monday-Friday
trade cron create \
  --name "EU Outreach" \
  --schedule "0 10 * * 1-5" \
  --deliver local \
  --prompt "Generate [X] personalized outreach emails for European prospects/customers in [COUNTRIES]. For each: reference something specific about them, explain value proposition, include clear CTA. Check CRM for follow-up sequence."

# Platform Check — 11:00 Monday-Friday
trade cron create \
  --name "Platform Check" \
  --schedule "0 11 * * 1-5" \
  --deliver local \
  --prompt "Generate platform review checklist for today. Include: new RFQ count, pending quotes requiring follow-up, product view trends, competitor activity notes. Platforms: [ALIBABA/INDIAMART/ETC]."

# Social Media — 14:00 Monday-Friday
trade cron create \
  --name "Social Media Post" \
  --schedule "0 14 * * 1-5" \
  --deliver local \
  --prompt "Generate social media post for [PLATFORM]. Today's content type: [TEXT/IMAGE/VIDEO/POLL]. Include: caption, hashtags, media suggestions. User exports [PRODUCT] targeting [AUDIENCE]."

# US Outreach — 16:00 Monday-Friday
trade cron create \
  --name "US Outreach" \
  --schedule "0 16 * * 1-5" \
  --deliver local \
  --prompt "Generate [X] personalized outreach emails for US/Americas prospects/customers. Same structure as EU outreach. Target markets: [US/CANADA/LATAM]."

# Daily Summary — 17:30 Monday-Friday
trade cron create \
  --name "Daily Summary" \
  --schedule "30 17 * * 1-5" \
  --deliver local \
  --prompt "生成每日工作总结。按以下步骤从实际数据中收集信息，不编造任何内容：1) database 工具查询 conversations 表今天的所有对话，提取实际操作类型；2) read_file 读取 ~/.hermes/cron/output/ 下今天各任务的输出文件；3) database 工具查询 customers 表今天新增/更新的客户；4) 从聊天记录中提取涉及客户沟通的内容生成待跟进提醒。所有数据必须来自工具查询结果，没有数据则写'今日无记录'。遵循 b2b-daily-automation SKILL.md 中 Task 7 的模板格式。"
```

### Cron Schedule Reference

| Schedule | Meaning |
|----------|---------|
| `0 8 * * 1-5` | 8:00 AM, Monday-Friday |
| `30 9 * * 1-5` | 9:30 AM, Monday-Friday |
| `0 10 * * 1-5` | 10:00 AM, Monday-Friday |
| `0 14 * * 1-5` | 2:00 PM, Monday-Friday |
| `0 16 * * 1-5` | 4:00 PM, Monday-Friday |
| `30 17 * * 1-5` | 5:30 PM, Monday-Friday |
| `0 18 * * 5` | 6:00 PM, Friday (Weekly report) |

## Phase 5: Integration with CRM

### Data Flow

```
┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│   Cron      │───▶│   Trade     │───▶│   User      │
│   Tasks     │    │   Assistant │    │   Executes  │
└─────────────┘    └─────────────┘    └─────────────┘
       │                  │                   │
       │                  ▼                   │
       │           ┌─────────────┐           │
       │           │   CRM       │◀──────────┘
       │           │   Updates   │
       └──────────▶│   (next day)│
                   └─────────────┘
```

### What Gets Logged

After each task execution:
- Emails sent → logged to CRM
- Follow-ups completed → logged to CRM
- Social posts published → logged to analytics
- Inquiries received → added to pipeline

## Phase 6: Task Customization

### Customizing for Your Business

**Adjust timing based on**:
- Your working hours
- Target market time zones
- Personal energy patterns (do creative work when you're fresh)

**Adjust content based on**:
- Industry (manufacturing needs more technical content)
- Product type (complex products need more education)
- Target audience (engineers vs. buyers vs. C-suite)

**Adjust frequency based on**:
- Platform activity levels
- Customer engagement rates
- Your capacity to execute

## Quality Standards

1. **内容真实性**：KPI 数据、询盘数量、业绩统计必须来自数据库查询或用户提供，不编造任何指标值。无数据时标注 "N/A — 数据待补充"
2. **Relevance**: Every piece of content must be specific to the user's industry and products
2. **Timeliness**: Posts go out during optimal engagement windows for target audiences
3. **Personalization**: Outbound messages reference specific prospect details
4. **Completeness**: Generated content is ready to use — no editing needed
5. **Consistency**: Same quality and tone across all automated outputs
6. **Actionability**: Every brief and summary has clear next steps

## Common Pitfalls

1. **Setting and forgetting**: Review automated outputs weekly, adjust based on results
2. **Generic content**: Without specific product info, content will be generic — provide details
3. **Too much automation**: Balance automated content with genuine personal engagement
4. **Ignoring analytics**: Track what's working and optimize timing/content
5. **Losing personal touch**: Automation handles routine; personal relationships need human contact
6. **Not following up on generated leads**: If you generate an inquiry response but don't follow up, automation is wasted
