← Back to Skills Marketplace
yuliuyi717-ux

Gmail Auto Draft

by yuliuyi717-ux · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
243
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install gmail-auto-draft
Description
Monitor Gmail inbox, read incoming emails, generate personalized follow-up replies with OpenAI, and save replies into Gmail Drafts for human review. Use when...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install gmail-auto-draft
  3. After installation, invoke the skill by name or use /gmail-auto-draft
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release with setup docs and fixed-input query workflow
Metadata
Slug gmail-auto-draft
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 243 downloads so far.

How do I install Gmail Auto Draft?

Run "/install gmail-auto-draft" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Gmail Auto Draft free?

Yes, Gmail Auto Draft is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Gmail Auto Draft support?

Gmail Auto Draft is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Gmail Auto Draft?

It is built and maintained by yuliuyi717-ux (@yuliuyi717-ux); the current version is v1.0.0.

💬 Comments