mono
管理钉钉产品能力(Agoal目标管理/AI表格/AI搜问/日历/通讯录/群聊与机器人/待办/审批/法务智能合同/考勤/日志/DING消息/开放平台文档/钉钉文档/钉钉云盘/原生Markdo…
钉钉通讯录精确查询。Use when 已有 userId 后查详情、部门、职位或邮箱,按完整手机号反查用户,或查询自己、部门成员及角色。姓名模糊搜索、工号、职责、上下级走 dingtalk-aisearch,拿到 userId 后用本 skill 补详情。命令前缀:dws contact。
$ npx -y skills add dingtalk-real-ai/dingtalk-workspace-cli --skill dingtalk-contact --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/dingtalk-contactContext preview
The summary Claude sees to decide when to auto-load this skill.
钉钉通讯录精确查询。Use when 已有 userId 后查详情、部门、职位或邮箱,按完整手机号反查用户,或查询自己、部门成员及角色。姓名模糊搜索、工号、职责、上下级走 dingtalk-aisearch,拿到 userId 后用本 skill 补详情。命令前缀:dws contact。
name: dingtalk-contact
description: 钉钉通讯录精确查询。Use when 已有 userId 后查详情、部门、职位或邮箱,按完整手机号反查用户,或查询自己、部门成员及角色。姓名模糊搜索、工号、职责、上下级走 dingtalk-aisearch,拿到 userId 后用本 skill 补详情。命令前缀:dws contact。
metadata:
cli_version: ">=0.2.14"
category: product
requires:
bins:
- dws> **CRITICAL — 执行任何 `dws` 操作前,MUST 先用 Read 工具完整读取 [`dingtalk-shared`](../dingtalk-shared/SKILL.md)。**该轻量文件包含全局执行契约、安全底线及 shared references 的按需加载导航;不要预加载其全部 references。
> 命令参考:[contact.md](references/contact.md);剧本:[08-directory.md](references/08-directory.md)。
<!-- VISIBLE_SHORTCUTS_START -->
以下 shortcut 同时进入公开 catalog 与 Runtime Schema。按本 skill/recipe 路由,命中时 Shortcut 优先于原子命令。参数只查 `dws schema --cli-path "contact +<shortcut>" --compact --jq '{cli_path,parameters,constraints,confirmation}' -f json`;仅需且已发布 `result` 时查 `--jq '{cli_path,outcomes:.result.outcomes,pagination}'`,字段级再查 `data_schema`;缺失不以 Help/样例推断。Schema 不可用才读一次已知 leaf Help;`unknown flag` 用同 leaf Help 修正一次。`unknown command` 禁 Help:错误 suggestion → 已加载 Skill/reference 明确入口;均无则报漂移。禁全 Catalog/root/parent/product Help;仅映射、接口或 provenance 审计省略 `--compact`。现有路由和 reference 均无法定位低频能力时,才用 `dws shortcut list --service contact --format json` 发现。
| Shortcut | 风险 | 适用场景 | |---|---|---| | `dws contact +by-mobile` | read | 按手机号查询某人的完整资料(自动解析 userId 后取详情) | | `dws contact +dept-members` | read | 按部门名列出部门成员(自动解析 deptId) | | `dws contact +list-dept-members` | read | 查看部门成员(仅本部门,不含下级) | | `dws contact +list-followings` | read | 获取当前用户的特别关注列表 | | `dws contact +list-role-members` | read | 查询角色下的成员列表 | | `dws contact +list-sub-depts` | read | 查看指定部门的子部门 | | `dws contact +lookup` | read | 按姓名查询某人的完整资料(自动解析 userId 后取详情) | | `dws contact +me` | read | 查看我自己的通讯录资料(姓名/userId/手机/部门/组织,干净投影) | | `dws contact +org` | read | 按姓名查某人所在部门的详情(自动解析 userId 与 deptId) | | `dws contact +resolve-dept` | read | 按名称搜索部门并解析出唯一 deptId(只读) | | `dws contact +search-mobile` | read | 按手机号搜索通讯录用户 | | `dws contact +search-user` | read | 按关键词搜索通讯录用户 | | `dws contact +team` | read | 按姓名列出某人所在部门的成员(自动解析 userId 与 deptId) | <!-- VISIBLE_SHORTCUTS_END -->
| 用户说 | 命令 | |--------|------| | "查我自己的信息" | `dws contact user get-self` | | "按 userId 查详情" | `dws contact user get --ids <userId1>,<userId2>,...`(多个并行) | | "完整手机号反查用户" | `dws contact user search-mobile --mobile <手机号>` | | "按部门名拉成员" | `python scripts/contact_dept_members.py --query "<部门名>"` | | "搜部门" | `dws contact dept search --query "<关键词>"` | | "部门成员列表" | `dws contact dept list-members --ids <deptId>` | | "列出企业角色 / 有哪些角色" | `dws contact label list` | | "按角色名查角色ID" | `dws contact label get --names "<角色名>"` | | "查某角色下有哪些成员" | `dws contact label list-members --id <labelId>` |
> 命中以下意图**必须**按对应 SOP 顺序执行;**禁止**跳步、替换命令、编造 userId。每条命令必须带 `--format json`。姓名模糊搜索、工号、职责与上下级走 `dingtalk-aisearch`;完整手机号精确反查走 contact;拿到 userId 后由 contact 补详情。
**触发**:按姓名/工号/部门/职责/上下级找人,或用手机号线索做语义搜索。
1. **切 aisearch(必须)**:`dws aisearch person --query "<关键词>" --dimension <维度> --format json`(姓名→`name`、工号→`jobNumber`、手机号语义线索→`phone`、负责人→`duty`、部门→`department`、上下级→`supervisor`/`subordinate`)。 2. **解析(必须)**:从结果取 `userId`、`title`;**多人同名禁止默认选第一个**,必须批量 `dws contact user get --ids <id1,id2,...> --format json` 拿部门/职位后让用户确认。 3. **补详情(必须)**:要完整部门/职位/邮箱/主管时 `dws contact user get --ids <userId> --format json`。
**禁止**:用 `contact user search` 做姓名或工号搜索、默认取首个候选、编造人员字段。完整手机号精确反查是 `search-mobile` 的唯一搜索例外。
**触发**:用户提供完整手机号并要求确认是谁或取得 userId。
1. **执行(必须)**:`dws contact user search-mobile --mobile "<完整手机号>" --format json`。 2. **补详情(按需)**:从结果取 `userId`,需要部门、职位或邮箱时继续 `dws contact user get --ids <userId> --format json`。
**禁止**:把完整手机号精确反查改走姓名搜索,或在未返回 userId 时猜测人员。
**触发**:已有 userId 要查完整详情,或要拿 userId 给下游(发消息/建待办/约日程)。
1. **拿 userId(必须)**:`dws aisearch person --query "<姓名>" --dimension name --format json` → `userId`;多命中必须列候选请用户确认。 2. **查详情(必须)**:`dws contact user get --ids <userId> --format json`,按返回字段(`orgEmployeeModel` 下部门/职位/邮箱)答复。
**禁止**:用模糊关键词直接调 `contact user search` 凑数、编造未返回字段。
**触发**:我的信息/我的 userId/我的部门。
1. **执行(必须)**:`dws contact user get-self --format json`,取 `orgEmployeeModel.userId` / `orgUserName` / `depts[].deptName` / 主管等。
**禁止**:把自己 userId 写死或猜测。
**触发**:部门列表/部门成员/角色/角色成员。
1. **执行(必须)**:搜部门 `dws contact dept search --query "<部门名>" --format json`;某部门下子部门 `dws contact dept list-children --dept <父部门ID> --format json`;部门成员 `dws contact dept list-members --ids <部门ID>[,<部门ID2>...] --format json`;部门详情 `dws contact dept get-info --dept <部门ID> --format json`。角色:`dws contact label list` / `dws contact label get --names "<角色名>"` / `dws contact label list-members --id <labelId>`。搜索企业根部门时服务端可能返回 `deptId=-1` 哨兵,后续 `list-children` / `list-members` / `get-info` 必须规范化为真实根部门 `deptId=1`。 2. **补详情(必须)**:拿到 userId 后用 `contact user get --ids` 补部门/职位;上下级关系优先经 `dingtalk-aisearch` 的 `supervisor`/`subordinate` 维度。
**禁止**:使用不存在的 `contact dept list`(已废弃/歧义)、编造 deptId/labelId、跳过 aisearch 维度直接猜上下级。
DingTalk Workspace is an officially open-sourced cross-platform CLI tool from DingTalk. It unifies DingTalk’s full suite of product capabilities into a single package, is designed for both human users and AI agent scenarios.
Repo: dingtalk-real-ai/dingtalk-workspace-cli
管理钉钉产品能力(Agoal目标管理/AI表格/AI搜问/日历/通讯录/群聊与机器人/待办/审批/法务智能合同/考勤/日志/DING消息/开放平台文档/钉钉文档/钉钉云盘/原生Markdo…
Create, edit, and validate DingTalk AI Card (A2UI) JSON files offline. Use for cards built…
AI搜问:人员语义搜索、跨源主题检索与行为回溯。Use when 语义找人,或目标未知时按主题或行为发现内容。原生最近列表走所属产品;完整手机号精确反查走…
钉钉 AI 表格(多维表)业务操作。Use when 用户需要操作 AI 表格/多维表/Base/Table、应用模式/App…
钉钉日历与会议室。Use when 用户说 约会议/查日程/订会议室/查闲忙/加参会人/改期/取消会议/今天的日程/本周日程/共同空闲。不做视频会议发起/邀请入会/会中控制(走…
钉钉群聊与消息。Use when 收发/搜索消息、建群、群治理、Bot/Webhook、文件,或仅限 IM 的消息谓词筛选。跨源主题/行为轨迹走…