CSlawyer1985/legal-skillhub / skills/agent-email
agent-email
VerifiedAgent 专用邮箱统一管理:让 Claude Code、Codex 等平台的 Agent 用一套命令收发邮件、整理收件箱、分发任务。支持网易 ClawEmail(claw.163.com)和腾讯 Agent Mail(QQ 邮箱,agent.qq.com)两家后端,通过 MAIL_PROVIDER 切换。当用户提到收发邮件、看收件箱、搜索邮件、回复转发邮件、下载附件、整理邮件、给其他 Agent 派邮件任务、配置 Agent 邮箱、腾讯 QQ 邮箱 Agent、网易 ClawEmail 时使用此 skill。
| File | Kind | Size |
|---|---|---|
| CHANGELOG.md | markdown | 4.1 KB |
| LICENSE.txt | markdown | 1.1 KB |
| SKILL.md | skill md | 10.1 KB |
| _meta.json | config | 104 B |
| references/agently-cli-guide.md | markdown | 9.0 KB |
| references/agently-overview.md | markdown | 3.3 KB |
| references/agently-setup-guide.md | markdown | 2.7 KB |
| references/backends-install.md | markdown | 4.4 KB |
| references/clawemail-mail-cli-guide.md | markdown | 6.2 KB |
| references/clawemail-overview.md | markdown | 7.7 KB |
| references/clawemail-setup-guide.md | markdown | 2.8 KB |
| scripts/.env.example | other | 1.5 KB |
| scripts/mail-ops.sh | script | 17.8 KB |
| templates/reply-template.md | markdown | 522 B |
references/agently-setup-guide.md
View on GitHub# 腾讯 Agent Mail 首次配置指南
## 前提
- 已安装 Node.js 18+(macOS: `brew install node`)
- 已在 [agent.qq.com](https://agent.qq.com) 开通 Agent Mail(用 QQ 邮箱账号登录)
- 已全局安装 agently-cli:`npm install -g @tencent-qqmail/agently-cli`
> 两家后端的安装对照见 `backends-install.md`。
## 方式一:一键配置(推荐)
本 skill 封装了 OAuth 全流程(后台 pty 跑 `auth login` + 自动抓授权 URL + 验证):
```bash
source skills/agent-email/scripts/mail-ops.sh
export MAIL_PROVIDER=agently
mail_login
```
`mail_login`(agently 后端的 `agently_login`)自动完成:
1. 检查 agently-cli 已安装
2. 后台开 pty 跑 `agently-cli auth login`,从输出抓取授权 URL
3. 原样展示授权 URL 给你(opaque,不编码 / 不拼接)
4. 你在浏览器完成授权后命令自动退出
5. 跑 `agently-cli +me` 验证,返回邮箱地址
成功后输出:
> 邮箱地址 xxx 已授权成功,可以用它来收发邮件了。
## 方式二:手动配置
### 1. 安装 CLI
```bash
npm install -g @tencent-qqmail/agently-cli
```
### 2. OAuth 授权
`agently-cli auth login` 是**交互式长命令**,必须后台运行(background + pty),从 stdout/stderr 提取它输出的原始授权 URL 给用户。用户在浏览器完成授权后命令自动退出。
**URL 输出规则**:将 URL 视为不可修改的 opaque string,不要做任何修改(包括 URL 编码 / 解码、添加空格或标点、重新拼接 query),用只包含原始 URL 的代码块单独展示。
```bash
agently-cli auth login
```
执行注意:
- **必须**先安装 / 更新 CLI 到最新
- 失败或超时**不要重试**,直接反馈错误
### 3. 验证
```bash
agently-cli +me
```
返回邮箱地址即授权成功。
### 4. 切到 agently 后端
在 `scripts/.env` 设 `MAIL_PROVIDER=agently`,或运行前 `export MAIL_PROVIDER=agently`。
## 配置产物
| 位置 | 说明 |
|------|------|
| agently-cli 自管 | OAuth 凭据由 CLI 保存到本机(不进 .env) |
| `scripts/.env` | 只记录 `MAIL_PROVIDER=agently`(和可选的 `AGENTLY_EMAIL` 备忘) |
## 常见问题
### 未找到 agently-cli
全局安装:`npm install -g @tencent-qqmail/agently-cli`。本 skill 不像网易那样走 npx 即用,腾讯 CLI 需要全局装(因为 OAuth 凭据要持久化在本机)。
### auth login 超时 / 失败
**不要重试**,直接看错误反馈。常见原因:CLI 版本旧(更新到最新)、网络问题、QQ 邮箱账号未开通 Agent Mail。
### 授权失效(exit code 3)
重新跑 `mail_login`(或 `agently-cli auth login`)走 OAuth。
### 切换回网易
`export MAIL_PROVIDER=claw` 即可,无需重新配置——两家凭据各自独立保存在本机。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |