
DingTalk Chat
FreeManage DingTalk messages and groups efficiently.
Free · Opens the source repo
What DingTalk Chat does
The DingTalk Chat skill provides a command-line interface for managing messages and group chats within the DingTalk platform. This skill is particularly useful for users who need to send, edit, or recall messages, create or manage group chats, and perform various messaging tasks without the need for a graphical interface. By using a structured command format, users can execute commands directly through the dws CLI, ensuring a streamlined experience when interacting with DingTalk's messaging features.
This skill supports a wide range of functionalities, including sending direct messages, managing group members, and searching chat history. Users can create new groups, upgrade existing ones, and manage group settings with specific commands. The skill also allows for advanced messaging options, such as sending files, utilizing bots, and integrating webhook notifications. Each command is designed to be straightforward, minimizing the need for guesswork and ensuring that users can achieve their objectives efficiently.
The DingTalk Chat skill is ideal for developers and team leaders who frequently use DingTalk for communication and collaboration. It is particularly beneficial for those who prefer command-line tools or need to automate messaging tasks as part of their workflows. With its focus on structured command execution and clear error handling, this skill is designed to enhance productivity and streamline communication processes within teams.
However, this skill is not intended for urgent communications such as phone calls or SMS, which are handled by other DingTalk functionalities. Users should also be aware that the skill requires precise command usage and does not support guesswork; incorrect commands or ambiguous inputs may lead to errors or unexpected results.
When to use it
Use this skill when you need to perform messaging tasks in DingTalk efficiently via the command line.
When not to use it
Avoid using this skill for urgent communications or when a graphical interface is preferred for user interaction.
What you can build with it
Send a Direct Message
Quickly send a direct message to a user by specifying their name and the message content.
Create a New Group Chat
Easily create a new group chat by providing member IDs or names, streamlining team collaboration.
Search Chat History
Utilize advanced search commands to filter and retrieve specific messages from your chat history.
How to install DingTalk Chat
View source1. Install with the skills CLI
npx skills add dingtalk-real-ai/dingtalk-workspace-cli/dingtalk-chat --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by dingtalk-real-ai钉钉群聊 / 消息 Skill
<!-- DWS_RUNTIME_CONTRACT_START -->最小 DWS 执行契约
- 只通过
dwsCLI 操作钉钉;结构化读取使用--format json,按真实返回判断结果。 - 已知命令直接执行。只有 leaf 参数或安全语义不确定时读取精确 Schema,只有 Cobra flag 不确定时读取精确 leaf Help;不要加载产品级 Catalog 代替选路。
- 不猜命令、flag、字段、ID、账号或时间。后续 ID 必须来自真实返回;零命中、多候选或类型不明时停止并消歧。
- 解析目标、读取上下文和最终执行必须使用同一 profile;不得跨组织复用 userId、openDingTalkId 或 openConversationId。多账号组织只使用明确的
isOrgCurrent=true默认账号;没有默认账号时要求用户指定,禁止选择第一项、最近登录或最近使用账号。 - 不输出或记录 token、refresh token、appSecret、webhook token 等凭据;宿主已注入认证时不要索要凭据。
- 写操作必须符合用户明确意图。是否需要确认以最终 Runtime gate 和 Schema 为准;需要确认时先说明对象、动作与影响,再追加
--yes。 - 写后按任务结果契约验证;不能仅凭退出码宣称成功。部分结果、未知投递状态和失败项必须如实保留。
- 时间戳面向用户展示时转换为带时区的可读时间;默认使用当前会话时区,必要时同时保留原值。
- 遇到认证、权限、profile、confirmation 或未知错误时,只加载
dingtalk-shared中对应 reference;不要连续猜测替代命令。
Shortcut 发现(按需)
chat 当前有 98 条公开 shortcut,完整清单保留在 Runtime Catalog 与 Schema,不在高频产品根 Skill 中重复展开。已知意图直接使用下方的优先路由、意图表或任务 reference;命令已选中时直接执行,只在参数/安全语义不确定时读取 leaf Schema,在当前 Cobra flags 不确定时读取 leaf Help。
仅当现有路由和 reference 都无法定位低频能力时,才执行 dws shortcut list --service chat --format json 做最后回退;不要为已知高频意图加载完整 Shortcut Catalog 或产品级 Schema。
Golden Route
按用户任务选择最小充分入口。公开层按意图分流;Resolver、发送执行、消息投影和错误契约在 Runtime 内复用,不把所有能力塞进一个万能命令。
| 用户意图 | 唯一推荐入口 | 关键边界 |
|---|---|---|
| <!-- dws-intent: chat.send.dm -->按姓名发简单文本或 Markdown | dws chat +dm --to <姓名> --text <内容> | CLI 解析唯一用户;多候选时停止,不先手工查 ID |
| <!-- dws-intent: chat.send.group -->按群名或 ID 发简单文本或 Markdown | dws chat +send-to-group --group <群名或ID> --text <内容> | 稳定 ID 直接使用;群名多候选时停止 |
| <!-- dws-intent: chat.send.advanced -->文件、Bot、Webhook、复杂 @ 或高级发送 | dws chat +messages-send | Bot 多群用 --groups/--groups-file 并检查逐项 ledger |
| <!-- dws-intent: chat.read.conversation -->读取指定会话、返回较多消息 | dws chat +chat-messages | 粗粒度读取;目标条件明确时优先 +search-msg |
| <!-- dws-intent: chat.search.filtered -->多维度条件搜索(发送者/关键词/@/类型,单/跨会话) | dws chat +search-msg | 目标条件明确时使用 |
| 查看指定群成员(用户/机器人) | dws chat +chat-members-list --group <群名或ID> | 唯一解析并全量读取 |
| 获取群邀请链接 | dws chat +chat-invite-url --group <群名或ID> | 多候选时停止 |
| 查看群机器人 | dws chat +chat-bots --group <群名或ID> | 返回稳定 bots[] |
| 修改群名称 | dws chat group rename --id <openConversationId> --name <新名称> | 只知群名时先用 +chat-search --query <群名> 唯一解析 ID;不猜 +chat-rename |
| 查看指定群内 @我的消息 | dws chat +at-me --group <群名> --page-all | 检查 complete;空结果仍返回数组 |
| 查看全部会话 | dws chat +conversation-list --page-all | 检查 complete / failures |
| 读取并下载消息资源 | 查询命令加 --download-resources | 不另起手工下载循环;下载失败项保留在结果中 |
| <!-- dws-intent: chat.conversation.list-top -->查看置顶会话 | dws chat +conversation-list-top | 会话 Top 与消息 Pin、消息 Top、Favorite 不同 |
| 监听 IM 事件 | 切换 dingtalk-misc → event.md | 由事件参考选择确定的 EventKey 和生命周期 |
以下次级入口在意图明确时直接使用,不需要先加载完整 Catalog:
| 用户意图 | 入口 |
|---|---|
| 已知消息 ID 批量读取详情 | dws chat +messages-mget |
| 已知资源引用单独下载 | dws chat +messages-resource-download |
| 按关键词搜索群 | dws chat +chat-search |
| 查看消息收藏 | dws chat +flag-list |
| <!-- dws-intent: chat.reply.quote -->引用回复 | dws chat +messages-reply;成功结果保留新消息/会话/投递与原消息来源上下文 |
| 撤回当前用户消息 | dws chat +messages-recall --msg-id <openMessageId>;可省略会话 ID,由 CLI 只读补齐;兼容单值 --message-ids |
| 已知话题主消息 ID 或 thread/topic ID 读取回复 | dws chat +thread-replies |
| <!-- dws-intent: chat.create.group -->按成员 ID 或姓名创建群聊 | dws chat +chat-create;成员/群主均可自然解析,任一歧义都会在创建前整体停止 |
| 跨全部会话查看 @我的消息 | dws chat +at-me --page-all |
发送入口边界
+dm:姓名目标的简单文本/Markdown,参数空间最小。+send-to-group:群名或稳定 ID 目标的简单文本/Markdown,避免暴露无关身份矩阵。+messages-send:文件、Bot、Webhook、复杂 @ 或幂等控制。user 已知 ID 可直接传,也可用--user-query/--chat-query运行同一只读解析链;Bot 多群使用--groups/--groups-file,返回im.batch-write.v1;bot/webhook 只使用下层真实支持的文本/Markdown 能力。- 文件直接传
+messages-send --file <相对路径>;不要先独立上传并提取 mediaId。 - Webhook 使用
+messages-send --as webhook --webhook-token <token>;不要退回原子 Webhook 命令。 - 流式卡片用
+messages-send-card;群聊@传 ID/--at-all,Runtime 把 create 返回前缀加到--content;禁写占位符;仅 text。
关键结果语义
openTaskId是发送任务 ID,不是回复或撤回所需的消息 ID;消息 ID 必须来自真实查询结果。- 消息查询默认保留稳定 ID、会话/thread、发送者、文本、时间、reaction、引用、转发和
resourceRefs;--no-reactions可关闭 reaction。 - 查询结果必须检查
complete、hasMore、failures和资源下载 ledger;partial result 不得表述为完整成功。 - 子消息使用自己的
messageId;仅缺会话 ID 时继承父消息的conversationId。 - 下载只允许工作目录内安全相对路径,默认不覆盖并原子落盘;覆盖必须由用户显式传
--overwrite。读取和下载不需要--yes。 - Favorite、消息 Pin、消息 Top、会话 Top 是不同对象层级,不能互换。
按需加载
只在任务命中时读取一个精确 reference:
| 场景 | Reference |
|---|---|
| 复杂发送、跨会话转发、共同群或组合流程 | 01-messaging.md |
| 编辑/撤回/引用/转发/卡片/reaction/Pin/Top/Favorite | chat-message.md |
| 建群、成员、管理员、群公告、群设置 | chat-group.md |
| Bot 搜索、入群、群发和撤回 | chat-bot.md |
| 会话置顶、分类、红点、免打扰和隐藏 | chat-conversation.md |
| 低频意图之间仍需消歧 | intent-guide.md |
| 表情名称与 ID | chat-emoji-list.md |
| 稳定结果、身份矩阵与能力边界 | contracts.md |
| 流式卡片创建 | card/create.md |
| 流式卡片更新 | card/update.md |
| 卡片 callback 是否可用 | card/callback.md |
| 卡片公开 Schema 边界 | card/schema.md |
| 只有上述 reference 仍无法定位的原子能力 | chat.md 的对应章节 |
不要预加载这些 reference。完整 Shortcut Catalog 只在根路由和精确 reference 都无法定位低频能力时使用。
错误最短路径
- resolution 返回零命中或多候选:停止写操作,展示候选并让用户消歧;禁止默认第一项。
unknown command/unknown flag:读取精确 leaf Help,修正后最多重试一次。- 参数约束或 confirmation 不清楚:读取精确 leaf Schema,以 Runtime gate 为准。
- 认证、权限、profile 或 confirmation 错误:读取
dingtalk-shared的对应 reference;正常 IM 不读取完整 shared Skill。 backend_dependency_unavailable:保持原参数,对只读命令最多重试一次;不要改 flag、猜认证命令或切换同义原子命令,持续失败时保留 Trace ID。- 其他错误:保留真实错误和已完成/失败项;不要连续尝试同义原子命令。
Frequently asked questions about DingTalk Chat
Similar skills
Agent-Browser Core
Efficient browser automation for AI agents.
Setup My IQ
Effortlessly create and update your personal context portfolio.
CRM Maintenance
Automate HubSpot updates from your calendar and emails.
Zoom MCP
Streamline access to Zoom meeting assets and recordings.
Slack Automation
Automate tasks and extract data from Slack easily.
SMB Onboard
Guides small business owners through initial tool setup.
