
Dingtalk Contact
Handles all DingTalk contact directory queries through their API. You get user search by keyword, full employee details (name, phone, employee ID, department, unionId), department trees, member lists, and headcount stats. The workflow is strict: it identifies your task type first, validates only the config you need for that specific operation (AppKey and AppSecret are always required, plus your own userId if querying relative to yourself), then fetches tokens and executes. Includes a helper script for token management and config storage, with fallback logic for invalidated tokens. The actual API calls live in a separate reference file you grep by operation number, which keeps the main guide clean.
- skills.sh installs
- 323
- GitHub stars
- 102
- last updated
- Aug 21, 2026
Install
$ npx -y skills add breath57/dingtalk-skills --skill dingtalk-contact --agent claude-codeInstalls into .claude/skills of the current project.
Files
钉钉通讯录技能
负责钉钉通讯录的所有查询操作。本文件为策略指南,仅包含决策逻辑和工作流程。完整 API 请求格式见文末「references/api.md 查阅索引」。
dt_helper.sh位于本SKILL.md同级目录的scripts/dt_helper.sh。
工作流程(每次执行前)
- 先识别本次任务类型 → 例如:搜索用户、查用户详情、搜索部门、列部门成员、查部门路径、统计员工数
- 按本次任务校验所需配置 → 通过
bash scripts/dt_helper.sh --get KEY读取;仅校验本任务必须项 - 仅收集缺失配置 → 若缺少某项,一次性询问用户所有缺失值,用
bash scripts/dt_helper.sh --set KEY=VALUE写入 - 获取 Token → 直接调用
bash scripts/dt_helper.sh - 执行操作 → 复杂的创建临时文件再执行,简单的直接执行;禁止 heredoc
按任务校验配置(必须先做)
- 所有任务通用必需:
DINGTALK_APP_KEY、DINGTALK_APP_SECRET - 需要“以当前操作者为起点”或“直接读取本人身份信息”的任务:必须有
DINGTALK_MY_USER_ID
规则:未通过“本次任务配置校验”前,不得进入 API 调用步骤。
凭证禁止在输出中完整打印,确认时仅显示前 4 位 +
****
所需配置
| 配置键 | 必填 | 说明 | 如何获取 |
|---|---|---|---|
DINGTALK_APP_KEY | ✅ | 应用 AppKey | 钉钉开放平台 → 应用管理 → 凭证信息 |
DINGTALK_APP_SECRET | ✅ | 应用 AppSecret | 同上 |
DINGTALK_MY_USER_ID | ❌ | 当前操作用户的 userId(即运行此技能的人自己),仅在需要以自身为起点查询时才需要 | 管理后台 → 通讯录 → 成员管理 → 点击姓名查看 |
身份标识说明
| 标识 | 说明 |
|---|---|
userId(= staffId) | 企业内部员工 ID,可通过通过管理后台 -> 通讯录 -> 成员管理 -> 点击姓名查看 |
unionId | 跨企业/跨应用唯一标识,可通过 bash scripts/dt_helper.sh --to-unionid <userid> 获取 |
Sponsors
Details
- Repository
- github.com/breath57/dingtalk-skills
- First seen
- Jun 3, 2026