微信发信能力:通过 Windows 桌面微信发送文本、图片URL或本地文件。适合各类 Agent 在本机直接发送一次性消息。触发词:给[某人]发微信、通知[某人]、把这个用微信发给[某人]、用微信发个图片、把本地文件发给[某人]
npx skills add https://github.com/LAVARONG/wechat-automation-api --skill wechat-automation
赋予智能体掌控 Windows 桌面微信直接向真实用户或群组发送文本、图片URL或本地文件的能力。本 Skill 默认以同步命令行方式运行,执行一次命令发送一次消息,命令结束后立即退出。
只发送微信消息时,不需要专门启动后台 HTTP API,不需要运行 run.bat,也不需要调用 scripts/app.py。但如果后台 HTTP API 恰好已在运行,本 Skill 会自动改走 API 队列模式发送,以避免多个请求同时直接操作微信窗体造成冲突,详见下文「执行模式与结果判定」。
本 Skill 调用后会直接返回结果并退出,不会常驻内存。请在项目根目录中使用以下语法调用:
python scripts/skill_cli.py --to "联系人或群组名称" --content "你要发送的具体文本"
python scripts/skill_cli.py --to "联系人或群组名称" --content "https://example.com/image.png" --action "sendpic"
如果 sendpic 的 --content 是本地路径,则不会下载图片,会直接按本地文件复制并粘贴到微信。
python scripts/skill_cli.py --to "联系人或群组名称" --content "C:\path\to\file.zip" --action "sendfile"
本地图片、PDF、Office 文档、压缩包等都使用 sendfile。Agent 发送自己刚生成的文件时,应优先使用绝对路径。
首次安装或接入 Agent 后,优先向“文件传输助手”发送测试消息:
python scripts/skill_cli.py --to "文件传输助手" --content "这是一条来自 Agent Skill 的测试消息"
stdout 输出 发送成功 表示任务完成。stdout 输出 发送失败 或 执行异常 时,应将错误信息原样反馈给用户。
如需更稳定地解析结果,可追加 --json:
python scripts/skill_cli.py --to "文件传输助手" --content "测试消息" --json
JSON 输出字段包含 success、code、message、to、action。success=true 表示发送请求已被成功受理;success=false 表示未成功(同步模式下即为发送失败,详见下文模式说明)。
本 Skill 有两种执行模式,默认会自动选择:
success 即为真实发送结果。失败会给出 CONTACT_NOT_FOUND、WECHAT_WINDOW_NOT_FOUND 等具体 code。需要确切知道"是否真的发出去了"时用这个模式。app.py / run.bat 已在运行,且 config.json 配好 token 时自动启用):把消息提交到后台 HTTP 队列,由后台串行异步发送,多个请求不会互相抢占微信窗体。注意:此模式下 success=true 仅表示"消息已入队受理",并不代表已成功送达;真实发送结果需查询后台 GET /status 或服务端日志 wechat_automation.log。可用以下参数显式指定模式(不加则自动判定):
| 参数 | 作用 |
| --- | --- |
| --no-api | 强制同步 CLI 模式,跳过 API 自动检测,确保拿到真实发送结果 |
| --api | 强制 API 队列模式(需先启动后台服务并配置 token,否则报错) |
# 强制同步发送并拿真实结果(不论后台 API 是否在运行)
python scripts/skill_cli.py --to "文件传输助手" --content "测试消息" --no-api --json
给 Agent 的判定建议:常规发信依据退出码与 success 判断任务是否被受理即可;若任务必须确认真实送达(如重要通知),请追加 --no-api 走同步模式,再据 code 反馈用户。
pip install -r requirements.txt。python scripts/skill_cli.py ... 可以找到 scripts/wechat_controller.py。若运行环境为精简版或 Ghost 系统,需确保 Windows 辅助功能正常运行。通过键盘 Win 键唤出开始菜单,输入“讲述人”并开启该功能(开启后可立即关闭),此操作可确保系统底层 UI 自动化接口处于激活状态,避免程序无法识别元素。
--to 参数指定的联系人或群组名称必须与微信内的备注或网名完全一致(区分大小写和空格),否则可能导致发送失败或发错人。0 表示请求已被受理;退出码非 0 表示失败。如果输出 发送失败 或 JSON 中 success=false,请原封不动把 message 和 code 反馈给用户,不要擅自循环重试。注意:当输出为 消息已提交发送队列受理… 时表示走了 API 队列模式(异步),仅代表受理成功;需确认真实送达请改用 --no-api。【1/3】...、【2/3】...、【3/3】...。\n)或表情符号文本,脚本层会自动处理转义与输入,请放心传入。C:\tmp\report.pdf。相对路径会按当前工作目录解析。CLI 会尽量给出明确失败原因,常见 code 包括:
WECHAT_WINDOW_NOT_FOUND:未找到微信窗口。请确认微信 PC 已启动并登录;精简版或 Ghost 系统可按“系统辅助功能启用”处理。CONTACT_NOT_FOUND:未找到联系人或群组。请确认 --to 与微信备注、联系人名或群名完全一致。SEARCH_BOX_NOT_FOUND:未找到微信搜索框。可能是微信 UI 结构变化、窗口未加载完成或系统 UI 自动化不可用。CHAT_INPUT_NOT_FOUND:未找到聊天输入框。可能未成功进入目标会话,或微信 UI 结构变化。CLIPBOARD_TEXT_FAILED:文本写入剪贴板失败。请检查系统剪贴板、pyperclip 或远程桌面会话状态。IMAGE_DOWNLOAD_FAILED / IMAGE_URL_NOT_IMAGE:图片 URL 下载失败或返回内容不是图片。IMAGE_CLIPBOARD_FAILED:图片复制到剪贴板失败。LOCAL_FILE_NOT_FOUND:本地文件不存在。请检查路径是否正确,建议使用绝对路径。LOCAL_FILE_INVALID:路径不是文件,当前不支持发送目录。FILE_CLIPBOARD_FAILED:本地文件复制到剪贴板失败。请检查系统剪贴板或远程桌面会话状态。SEND_FILE_ERROR:发送本地文件异常。DEPENDENCY_MISSING:缺少 Python 依赖。请在项目根目录执行 pip install -r requirements.txt。CLI_EXCEPTION:CLI 自身执行异常。Agent 遇到失败时应停止当前发送任务,把错误原因反馈给用户,并建议用户检查对应环境或联系人名称。
如需维护或扩展元素查找逻辑,建议使用 Visual Studio SDK 自带的 Inspect.exe 工具(或 Windows SDK 工具包),用于实时查看微信窗口的 UI 元素树结构、Name、AutomationID 及 ClassName 等关键属性,辅助编写元素查找逻辑。
> This skill applies brand guidelines to content creation. It should be used when the user asks to "write an email", "draft a proposal", "create a pitch deck", "write a LinkedIn post", "draft a presentation", "write a Slack message", "draft sales content", or any content creation request where brand voice should be applied. Also triggers on "on-brand", "brand voice", "enforce voice", "apply brand guidelines", "brand-aligned content", "write in our voice", "use our brand tone", "make this sound like us", "rewrite this in our tone", or "this doesn't sound on-brand". Not for generating guidelines from scratch (use guideline-generation) or discovering brand materials (use discover-brand).
This skill should be used when the user asks to "write a post", "check my voice", "look up contact", "prepare for meeting", "weekly review", "track goals", or mentions personal brand, content creation, network management, or voice consistency.
Generate configurable chat motion overlays from a transcript or screenshot, including plain bubble scenes, app-style chat containers, optional device frames, preset or uploaded avatars, nickname display rules, and transparent-video-ready Remotion bundles. Use when Codex needs to create reusable short-form chat clips for Douyin, demo videos, story reenactments, social-message proof scenes, or embeddable alpha overlays for Hyperframe and Remotion workflows.
Realistic macOS notification banner with app icon, title, and body, suited to video overlays or product teasers.
Review content against your brand voice, style guide, and messaging pillars, flagging deviations by severity with specific before/after fixes. Use when checking a draft before it ships, when auditing copy for voice consistency and terminology, or when screening for unsubstantiated claims, missing disclaimers, and other legal flags.
List recent meetings and voice memos. Use when the user asks "what meetings did I have", "show my recent recordings", "any meetings today", "list my voice memos", or wants an overview of their meeting history. Also use when they need to find a specific meeting by browsing rather than searching.
List recent meetings and voice memos. Use when the user asks "what meetings did I have", "show my recent recordings", "any meetings today", "list my voice memos", or wants an overview of their meeting history. Also use when they need to find a specific meeting by browsing rather than searching.
Start or stop recording a meeting, call, or voice memo. Use this whenever the user says "record", "start recording", "capture this meeting", "stop recording", "I'm in a meeting", "take notes on this call", or wants to transcribe live audio. Also use when they ask about recording status or want to know if something is being recorded.
Take lavarong/wechat-automation from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference pip.
Without those the skill loads but fails at the first command.