skills/email-automation/SKILL.md
# Email Automation Skill 邮箱自动化:读取、搜索、草拟、发送邮件。 ## 支持的方式 ### 方式 1: Gmail API (推荐) **优点**: 功能完整,支持标签、搜索、草稿 **配置步骤**: 1. 访问 [Google Cloud Console](https://console.cloud.google.com/) 2. 创建项目 → 启用 Gmail API 3. 创建 OAuth 2.0 凭据(桌面应用) 4. 下载 `credentials.json` 5. 存储到 `~/.config/gmail/credentials.json` ```bash # 安装依赖 pip3 install google-auth-oauthlib google-api-python-client # 首次授权(会打开浏览器) python3 ~/clawd/skills/email-automation/gmail_auth.py ``` ### 方式 2: IMAP/SMTP (通用) **优点**: 支持任何邮箱 **配置**: ``
npx skillsauth add aaaaqwq/claude-code-skills skills/email-automationInstall 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.
邮箱自动化:读取、搜索、草拟、发送邮件。
优点: 功能完整,支持标签、搜索、草稿 配置步骤:
credentials.json~/.config/gmail/credentials.json# 安装依赖
pip3 install google-auth-oauthlib google-api-python-client
# 首次授权(会打开浏览器)
python3 ~/clawd/skills/email-automation/gmail_auth.py
优点: 支持任何邮箱 配置:
# 存储凭据
pass insert email/gmail-address # 邮箱地址
pass insert email/gmail-app-pass # 应用专用密码(非登录密码)
Gmail 应用专用密码获取:
使用 n8n 的 Gmail/IMAP 节点,通过 webhook 触发。
# gmail_read.py
from googleapiclient.discovery import build
from google.oauth2.credentials import Credentials
creds = Credentials.from_authorized_user_file('token.json')
service = build('gmail', 'v1', credentials=creds)
# 获取最新 10 封邮件
results = service.users().messages().list(
userId='me', maxResults=10, q='is:unread'
).execute()
for msg in results.get('messages', []):
detail = service.users().messages().get(
userId='me', id=msg['id'], format='metadata'
).execute()
headers = {h['name']: h['value'] for h in detail['payload']['headers']}
print(f"From: {headers.get('From')}")
print(f"Subject: {headers.get('Subject')}")
print("---")
# Gmail 搜索语法
queries = {
"未读": "is:unread",
"今天": "newer_than:1d",
"重要": "is:important",
"带附件": "has:attachment",
"来自某人": "from:[email protected]",
"主题包含": "subject:关键词",
}
# gmail_send.py
import base64
from email.mime.text import MIMEText
def create_message(to, subject, body):
message = MIMEText(body)
message['to'] = to
message['subject'] = subject
raw = base64.urlsafe_b64encode(message.as_bytes()).decode()
return {'raw': raw}
def send_email(service, to, subject, body):
message = create_message(to, subject, body)
service.users().messages().send(userId='me', body=message).execute()
import imaplib
import email
# 连接
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login(EMAIL, APP_PASSWORD)
mail.select('inbox')
# 搜索未读
status, messages = mail.search(None, 'UNSEEN')
for num in messages[0].split():
status, data = mail.fetch(num, '(RFC822)')
msg = email.message_from_bytes(data[0][1])
print(f"From: {msg['from']}")
print(f"Subject: {msg['subject']}")
| 操作 | 权限级别 | |------|----------| | 读取邮件列表 | 🟢 自由 | | 读取邮件内容 | 🟢 自由 | | 搜索邮件 | 🟢 自由 | | 创建草稿 | 🟢 自由 | | 发送邮件 | 🟡 需确认 | | 删除邮件 | 🟡 需确认 | | 修改标签 | 🟢 自由 |
⚠️ 需要确认发送邮件:
收件人: [email protected]
主题: Re: 关于项目进度
内容预览:
---
你好,
关于项目进度...
---
回复 "确认" 发送,或 "取消" 放弃
每天早上检查未读邮件,生成摘要推送到 Telegram
监控特定发件人/关键词,立即通知
收到邮件后自动生成回复草稿,等待确认后发送
完成配置后,在 TOOLS.md 中记录:
### Email
- Provider: Gmail
- Address: [email protected]
- Auth: OAuth 2.0 / App Password
- Token: ~/.config/gmail/token.json
- 权限: 读取 ✅ | 发送 ⚠️需确认
gmail_auth.py - OAuth 授权脚本gmail_read.py - 读取邮件gmail_send.py - 发送邮件SECURITY.md - 安全策略testing
通用自媒体文章自动发布工具。支持百家号、搜狐号、知乎、微信公众号、小红书、抖音号六个平台的自动化发布流程。使用Playwright自动化实现平台导航和发布,支持通过storageState管理Cookie实现账号切换。
development
# SKILL.md - Model Configuration Status (mcstatus) ## 触发条件 - `/mcstatus` 命令 - 用户询问模型配备、模型配置、model status、模型列表等 ## 功能 实时生成 Agent + Cron 的模型配置报告,展示当前所有 agent 的主模型/fallback链和所有 cron 任务的模型分配。 ## 执行步骤 ### Step 1: 收集 Agent 模型配置 读取各 agent 的 models.json 获取主模型和 fallback 链: ```bash for agent in main ops code quant data research content market finance pm law product sales batch; do config=$(cat ~/.openclaw/agents/$agent/agent/models.json 2>/dev/null) if [ -n "$config" ]; then echo "=== $agent
tools
MCP 服务器智能管理助手。自动检测 MCP 可用性、智能开关、功能问答,提供人性化的 MCP 管理体验。
tools
从GitHub搜索并自动安装配置MCP(Model Context Protocol)服务器工具到Claude配置文件。当用户需要安装MCP工具时触发此技能。工作流程:搜索GitHub上的MCP项目 -> 提取npx配置 -> 添加到~/.claude.json -> 处理API密钥(如有)。