← 返回 Skills 市场
yuliuyi717-ux

Gmail Auto Draft

作者 yuliuyi717-ux · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
243
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install gmail-auto-draft
功能描述
Monitor Gmail inbox, read incoming emails, generate personalized follow-up replies with OpenAI, and save replies into Gmail Drafts for human review. Use when...
使用说明 (SKILL.md)

Gmail Auto Draft

Use this skill to build or run a review-safe Gmail reply workflow: read new emails, generate AI reply text, and save drafts instead of sending directly.

Quick workflow

  1. Prepare Google OAuth credentials.
  2. Use local GMN endpoint (openclaw:main) or set external OpenAI key.
  3. Run one-shot mode to validate draft creation.
  4. Tune query and prompt style.
  5. Switch to polling mode for continuous monitoring.

Run commands

Install dependencies:

cd skills/gmail-auto-draft/scripts
python3 -m pip install -r requirements.txt

Default backend (local GMN via OpenClaw gateway):

export OPENAI_BASE_URL="http://127.0.0.1:18789/v1"
export OPENAI_MODEL="openclaw:main"

Or use OpenAI directly:

export OPENAI_API_KEY="your_openai_key"
export OPENAI_MODEL="gpt-4o-mini"

One-shot test:

./run_once.sh --auth-mode local --max-emails 3

Continuous monitor:

./run_once.sh --poll-interval 60 --max-emails 5 --mark-read

Upwork demo profile (lead-focused query + fixed agency tone):

./run_upwork_demo.sh --auth-mode local --max-emails 5

Common options

  • --query: Gmail search filter for target emails.
  • --max-emails: max messages per cycle.
  • --poll-interval: seconds between cycles (0 means run once).
  • --openai-model: model name (default openclaw:main).
  • --openai-base-url: OpenAI-compatible base URL (default http://127.0.0.1:18789/v1).
  • --agency-profile: business context for OpenAI prompt.
  • --agency-profile-file: load agency context from a text file.
  • --style-rules: response style constraints.
  • --style-rules-file: load style rules from a text file.
  • --query-file: load Gmail query from a text file.
  • --mark-read: mark processed messages as read.
  • --processed-label: label for already drafted emails (default openclaw_auto_drafted).

Output behavior

The script prints JSON for each cycle:

  • processed: number of drafted replies
  • created_drafts: draft metadata
  • skipped: skipped message reasons
  • errors: per-message errors

Resources

  • Script: scripts/gmail_auto_draft.py
  • Runner: scripts/run_once.sh
  • Demo runner: scripts/run_upwork_demo.sh
  • Dependencies: scripts/requirements.txt
  • Setup guide: references/setup.md
  • Prompt/query tuning: references/prompt-tuning.md
  • Demo config: references/upwork-demo/agency_profile.txt
  • Demo config: references/upwork-demo/style_rules.txt
  • Demo config: references/upwork-demo/gmail_query.txt
安全使用建议
This skill does what it says: it reads unread Gmail messages matching your query, sends message content + context to a model to generate reply text, and saves drafts. Before installing/running: (1) Decide which model endpoint to use — prefer a local OpenClaw gateway if you need to avoid sending PII to OpenAI; the default docs point to localhost but you can set OPENAI_API_KEY to use OpenAI. (2) Create a dedicated Google OAuth client and review scopes (gmail.modify, gmail.compose); consider running with a test account first. (3) Be aware the script stores OAuth tokens at ~/.config/gmail-auto-draft/token.json and may read ~/.openclaw/openclaw.json for a gateway token. (4) Use one-shot mode and inspect created drafts before enabling polling/mark-read. (5) If you need stricter privacy, audit network calls in the script or run it in an isolated environment/account.
功能分析
Type: OpenClaw Skill Name: gmail-auto-draft Version: 1.0.0 The gmail-auto-draft skill is a legitimate automation tool designed to monitor a Gmail inbox and generate AI-assisted reply drafts. The core logic in `gmail_auto_draft.py` uses official Google and OpenAI client libraries to fetch emails and create drafts, maintaining a 'human-in-the-loop' workflow by not sending emails automatically. While it requires broad Gmail permissions (modify/compose) and reads local OpenClaw configuration files for authentication, these actions are transparently documented and strictly necessary for its stated purpose. No evidence of data exfiltration, backdoors, or malicious prompt injection was found.
能力评估
Purpose & Capability
The name/description (Gmail monitoring, AI-generated drafts) matches the included code and docs. The script uses Gmail API scopes to read messages and create drafts and calls an OpenAI-compatible client to generate text — all expected for this functionality.
Instruction Scope
Runtime instructions and the script operate within the described scope (poll Gmail, build prompts from message content + agency/profile/style files, call a model, create drafts, optionally mark read). Important privacy note: inbound message bodies and metadata are sent to the configured model endpoint (local OpenClaw gateway or external OpenAI) as part of prompt generation; this is explicit in the docs but is a meaningful data flow to confirm before use.
Install Mechanism
This is an instruction-only skill with bundled scripts and a requirements.txt; there is no remote download/install step. Dependencies are standard Python libraries (google-api-client/openai) and are proportional to the task.
Credentials
The registry metadata lists no required env vars, but the code and docs expect environment variables (OPENAI_BASE_URL, OPENAI_MODEL, or OPENAI_API_KEY) and a Google OAuth client secret file. The script also reads ~/.openclaw/openclaw.json to obtain a gateway token if present and writes OAuth tokens to ~/.config/gmail-auto-draft/token.json — these are explainable by the local gateway option but are worth noting because they grant access to model/gateway credentials and store Gmail tokens on disk.
Persistence & Privilege
The skill does not request always:true or elevated platform privileges. It writes its own token file (~/.config/gmail-auto-draft/token.json) and may create a Gmail label for processed messages — both are expected for the stated behavior and limited in scope.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install gmail-auto-draft
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /gmail-auto-draft 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release with setup docs and fixed-input query workflow
元数据
Slug gmail-auto-draft
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Gmail Auto Draft 是什么?

Monitor Gmail inbox, read incoming emails, generate personalized follow-up replies with OpenAI, and save replies into Gmail Drafts for human review. Use when... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 243 次。

如何安装 Gmail Auto Draft?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install gmail-auto-draft」即可一键安装,无需额外配置。

Gmail Auto Draft 是免费的吗?

是的,Gmail Auto Draft 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Gmail Auto Draft 支持哪些平台?

Gmail Auto Draft 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Gmail Auto Draft?

由 yuliuyi717-ux(@yuliuyi717-ux)开发并维护,当前版本 v1.0.0。

💬 留言讨论