skills/email-automation/SKILL.md
邮箱自动化:读取、搜索、草拟和发送邮件,支持 Gmail API 以及通用 IMAP/SMTP 流程。
npx skillsauth add aaaaqwq/agi-super-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
AI驱动的智能浏览器自动化工具。使用LLM理解页面并自动执行任务,比传统Playwright更智能、更省token。适用于复杂交互、动态页面、需要智能决策的浏览器操作。Chrome浏览器优先。
tools
网页登录态管理。使用 fast-browser-use (fbu) 管理各平台登录状态,定期检查可用性,新平台授权时自动保存 profile。
development
Monitor and report on API provider quotas, balances, and usage. Query official providers (Moonshot, DeepSeek, xAI, Google AI Studio) and relay/proxy providers (Xingjiabiapi, Aixn, WoW) via their billing APIs. Also checks subscription services (Brave Search, OpenRouter). Generates quota reports. Triggers on "查额度", "API余额", "quota check", "billing report", "api balance", "供应商额度", "中转站余额", "费用报告", "check balance", "how much credit".
development
# A股基金监控 Skill A股基金净值监控,支持实时估值和盘后净值,自动判断交易日/节假日。 ## 用法 ### 快速监控(命令行) ```bash # 默认配置,输出到控制台 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh # 推送到群(使用--push参数) bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --push # 监控指定基金 bash ~/clawd/skills/a-fund-monitor/scripts/monitor.sh --codes "000979 002943" ``` ### Agent调用 ``` 执行A股基金监控任务。 1. 读取配置文件: ~/clawd/skills/a-fund-monitor/config.json 2. 获取实时净值数据 3. 非交易日自动切换为简短报告 配置文件格式: { "funds": [ {"code": "000979", "name": "景顺长城沪港深精选股票