Xpersona
D

dingtalk-doc-enterprise

CLAWHUB · Unverified

操作用户通过 URL 指定且有权限访问的已有钉钉文档。仅在消息明确包含 `alidocs.dingtalk.com`、`钉钉文档`、`钉钉知识库`、`alidocs`,或当前上下文已确认对象是钉钉文档时使用。支持读取、覆写,以及插入、修改、删除文档内容块;严禁创建文档,包括空白文档。 Skill: dingtalk-doc-enterprise Owner: shyzhen Summary: 操作用户通过 URL 指定且有权限访问的已有钉钉文档。仅在消息明确包含 alidocs.dingtalk.com、钉钉文档、钉钉知识库、alidocs,或当前上下文已确认对象是钉钉文档时使用。支持读取、覆写,以及插入、修改、删除文档内容块;严禁创建文档,包括空白文档。 Tags: latest:1.0.8 Version history: v1.0.8 | 2026-08-18T08:43:56.747Z | user Version 1.0.8 of dingtalk-doc-enterprise - No file changes detected in this release. - No user-facing changes or new features documented. v1.0.7 | 2026-0

62
Rank
84
Safety
1.2k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.2K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s176r4qctym5nvv0a83rs6nkex843rkg:dingtalk-doc-enterprise
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-shyzhen-dingtalk-doc-enterprise/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

76,132 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: dingtalk-doc-enterprise
description: 操作用户通过 URL 指定且有权限访问的已有钉钉文档。仅在消息明确包含 `alidocs.dingtalk.com`、`钉钉文档`、`钉钉知识库`、`alidocs`,或当前上下文已确认对象是钉钉文档时使用。支持读取、覆写,以及插入、修改、删除文档内容块;严禁创建文档,包括空白文档。
metadata: {"openclaw":{"emoji":"📄","requires":{"bins":["node"],"env":["DINGTALK_CLIENTID","DINGTALK_CLIENTSECRET"]}}}
---

# 钉钉文档企业版

使用同目录的 `doc-enterprise.js` 操作用户通过 URL 指定的已有钉钉文档。

## 能力边界

- 只操作已有文档;只接受钉钉文档 URL 或明确的 docKey。
- 允许读取、整篇覆写,以及插入、修改、删除内容块。
- `insert` 是向已有文档插入内容块,属于修改文档,不是创建文档。
- `delete` 是删除内容块,不删除文档实体。
- 不列出或搜索用户的文档。
- 严禁创建文档,包括空白文档;也不得创建知识库、文件夹或文档副本。
- 不得自行拼接、调用或建议任何未在“命令映射”中列出的创建接口。
- 用户要求创建或新建时,直接说明本 skill 不支持,不要用其他命令模拟创建。

## 身份和权限

必需环境变量:

- `DINGTALK_CLIENTID`
- `DINGTALK_CLIENTSECRET`

线上身份按以下优先级解析:

1. `OPENCLAW_SENDER_ID`
2. `DINGTALK_SENDER_ID`
3. `DINGTALK_OPERATOR_ID`,仅作为本地调试回退;线上不要配置

将 sender_id 查询为 unionId,并将其作为 API 的 `operatorId`。钉钉 API 依据当前用户对目标文档的实际权限决定操作是否成功;不要把“可以读取”解释为“必然可以修改或删除”。

## 执行入口

将相对路径按 `SKILL.md` 所在目录解析,并使用脚本绝对路径:

```bash
node /absolute/path/to/doc-enterprise.js <command> [args]
```

支持以下链接形式:

```text
https://alidocs.dingtalk.com/i/nodes/<docKey>
https://alidocs.dingtalk.com/i/nodes/<docKey>?utm_scene=person_space
alidocs.dingtalk.com/i/nodes/<docKey>
```

## 命令映射

### 读取概览

```bash
node /absolute/path/to/doc-enterprise.js read <docKey-or-url>
```

只在用户要求快速查看时使用。需要总结、定位内容块或执行块级操作时使用 `blocks`。

### 获取完整块结构

```bash
node /absolute/path/to/doc-enterprise.js blocks <docKey-or-url>
```

用于总结正文、获取 `blockId`/`id` 和 `position`/`index`,以及在修改或删除前确认目标。

### 覆写整篇内容

```bash
node /absolute/path/to/doc-enterprise.js update <docKey-or-url> <markdown>
```

仅在用户明确要求替换整篇内容,并且新内容完整明确时使用。此操作会替换已有正文。

### 插入段落块

```bash
node /absolute/path/to/doc-enterprise.js insert <docKey-or-url> <position> <text>
```

- `position` 必须是大于或等于 0 的整数。
- 用户要求“追加一段”时,先运行 `blocks` 确认末尾位置,再插入新的段落块。
- 不要调用 `paragraphs/{blockId}/text` 的 append-text 接口。

### 修改段落块

```bash
node /absolute/path/to/doc-enterprise.js modify <docKey-or-url> <blockId> <text>
```

先运行 `blocks`,确认目标是段落块且 `blockId` 正确。该命令用新文本替换目标段落块。

### 删除内容块

```bash
node /absolute/path/to/doc-enterprise.js delete <docKey-or-url> <blockId>
```

- 用户说“删除第 3 段”时,先运行 `blocks` 定位并确认第 3 段,再删除对应内容块。
- 用户要求清空内容时,先运行 `blocks`,逐个删除可删除的正文块;不要删除文档实体,也不要创建空白文档替换原文档。
- 目标存在歧义时,先向用户确认,不要猜测 blockId。

## 工作流程

1. 从当前消息或已确认的上下文提取钉钉文档 URL/docKey。
2. 拒绝任何创建文档、空白文档、知识库、文件夹或副本的请求。
3. 读取概览用 `read`;总结、定位、修改或删除前用 `blocks`。
4. 根据意图只调用 `update`、`insert`、`modify` 或 `delete`。
5. 对覆写和删除操作复述目标;目标不明确时先确认。
6. 返回实际执行结果,不把 API 拒绝描述成操作成功。

## 错误处理

- 缺少应用凭证:提示配置 `DINGTALK_CLIENTID` 和 `DINGTALK_CLIENTSECRET`。
- 缺少当前用户身份:检查连接器是否传入 `OPENCLAW_SENDER_ID`;仅本地调试时使用 `DINGTALK_OPERATOR_ID`。
- `forbidden.accessDenied`:说明当前用户没有执行该操作所需的文档权限,或应用缺少相应权限。
- `docNotExist` / `nodeNotExist`:检查 URL/docKey,说明文档不存在或标识不正确。
- `blockNotExist`:重新运行 `blocks` 并核对内容块 ID。
- `paramError`:优先检查 URL/docKey、blockId 和 position。

## 参考

- 人工配置与能力说明:`README.md`
- 执行脚本:`doc-enterprise.js`

README.md

# 钉钉文档企业版技能(dingtalk-doc-enterprise)

通过钉钉开放平台企业 API 管理钉钉文档,支持多用户场景,自动从钉钉连接器获取当前用户身份。

> 背景:我在使用openclaw和钉钉的官方连接器,但是他们不支持这些功能(最新版本0.8.13)。
>
> 这是我的issue: https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/456
>
> 网上找遍了资源,也加入了钉钉开发群,都说不支持、还说没有操作文档的API。
>
> 连接器的文档说["钉钉文档能力依赖 MCP(Model Context Protocol)提供底层 tool"](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector?tab=readme-ov-file#%E9%92%89%E9%92%89%E6%96%87%E6%A1%A3docs%E4%B8%8E-mcpdocs) ,这种方案全是权限问题。
>
> [于是有了这个玩具。](https://clawhub.ai/shyzhen/dingtalk-doc-enterprise)
>
> 20260422 最新说明:支持白名单写入控制的使用这个skill https://clawhub.ai/shyzhen/dingtalk-doc

---

## 能力范围

- 根据钉钉文档 URL 读取文档内容和块结构
- 覆写已有文档内容
- 在已有文档中插入、修改、删除内容块
- 根据 OpenClaw 钉钉连接器提供的当前用户身份调用 API
- 不提供任何文档创建能力,包括创建空白文档
- 不删除文档实体;`delete` 只删除内容块
- 不列出或搜索用户文档

## 配置

在 OpenClaw 环境中配置:

```bash
# ~/.openclaw/.env
DINGTALK_CLIENTID=dingxxxxxx
DINGTALK_CLIENTSECRET=your_secret
```

修改配置后重启 OpenClaw Gateway。

在钉钉开放平台为企业内部应用申请:

| 权限码 | 用途 |
|---|---|
| `qyapi_get_member` | 将连接器提供的 sender_id 查询为 unionId |
| `Storage.File.Read` | 读取已有文档内容 |
| `Storage.File.Write` | 修改已有文档内容和内容块 |

`Storage.File.Write` 可能同时覆盖其他写入能力,但本 skill 的脚本和命令白名单均不实现创建文档接口。

## 当前用户身份

身份解析优先级:

1. `OPENCLAW_SENDER_ID`
2. `DINGTALK_SENDER_ID`
3. `DINGTALK_OPERATOR_ID`,仅用于本地调试回退

线上不要配置 `DINGTALK_OPERATOR_ID`。脚本会把当前 sender_id 查询为 unionId,并作为 `operatorId` 调用文档 API,因此最终权限由钉钉按照当前用户对目标文档的权限判定。

## CLI

```bash
node doc-enterprise.js read <docKey|url>
node doc-enterprise.js blocks <docKey|url>
node doc-enterprise.js update <docKey|url> "<markdown>"
node doc-enterprise.js insert <docKey|url> <position> "<text>"
node doc-enterprise.js modify <docKey|url> <blockId> "<text>"
node doc-enterprise.js delete <docKey|url> <blockId>
```

| 命令 | 含义 |
|---|---|
| `read` | 输出已有文档的内容块概览 |
| `blocks` | 输出完整块结构,用于总结或定位块 ID |
| `update` | 用 Markdown 覆写已有文档正文 |
| `insert` | 在已有文档中插入段落块,位置支持 `0` |
| `modify` | 替换已有段落块的文本 |
| `delete` | 删除已有文档中的指定内容块 |

脚本没有 `create`、`create-doc`、`create-workspace`、`copy` 等命令。未知命令会直接拒绝。

## 推荐操作流程

块级修改或删除前先读取结构:

```bash
node doc-enterprise.js blocks "https://alidocs.dingtalk.com/i/nodes/xxx"
node doc-enterprise.js modify "https://alidocs.dingtalk.com/i/nodes/xxx" <blockId> "新文本"
node doc-enterprise.js delete "https://alidocs.dingtalk.com/i/nodes/xxx" <blockId>
```

用户要求“追加一段”时,根据 `blocks` 返回的位置调用 `insert`。不再使用 `POST /paragraphs/{blockId}/text`:仓库中的 `dingtalk-doc` 已记录该接口在真实测试中返回 `InvalidAction.NotFound`。

## API 范围

| 操作 | 端点 | 方法 |
|---|---|---|
| 查询内容块 | `/v1.0/doc/suites/documents/{docKey}/blocks` | GET |
| 覆写已有文档 | `/v1.0/doc/suites/documents/{docKey}/overwriteContent` | POST |
| 插入内容块 | `/v1.0/doc/suites/documents/{docKey}/blocks` | POST |
| 修改内容块 | `/v1.0/doc/suites/documents/{docKey}/blocks/{blockId}` | PUT |
| 删除内容块 | `/v1.0/doc/suites/documents/{docKey}/blocks/{blockId}` | DELETE |

不包含创建或删除文档实体的 API。

## 常见错误

| 错误 | 处理 |
|---|---|
| 缺少 `DINGTALK_CLIENTID` / `DINGTALK_CLIENTSECRET` | 配置企业内部应用凭证并重启 Gateway |
| 缺少当前用户身份 | 检查连接器是否传入 `OPE

_meta.json

{
  "ownerId": "kn73t8gpykqmgx10ksfb6706r5842gge",
  "slug": "dingtalk-doc-enterprise",
  "version": "1.0.8",
  "publishedAt": 1787042636747
}

skill-card.md

## Description:

Operates on existing DingTalk documents that the user identifies by URL or docKey and is authorized to access, supporting read, overwrite, insert, modify, and delete-block operations while explicitly refusing document creation.

This skill is ready for commercial/non-commercial use.

## Publisher:

[shyzhen](https://clawhub.ai/user/shyzhen)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and OpenClaw users use this skill to let an agent read and update existing DingTalk enterprise documents through user-provided document URLs. It is intended for document maintenance workflows where the current DingTalk user already has access to the target document.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The skill uses DingTalk enterprise app credentials to read and change existing documents.

Mitigation: Install it only for workflows that require DingTalk document access, keep credentials scoped to the intended enterprise app, and do not expose them in prompts or logs.

Risk: Overwrite and delete-block operations can be destructive if the document or block target is wrong.

Mitigation: Confirm the document URL or docKey and inspect block structure before update, delete, or ambiguous block-level changes.

Risk: Configuring a local debug operator identity in production can bypass the expected current-user identity flow.

Mitigation: Use OPENCLAW_SENDER_ID or DINGTALK_SENDER_ID in deployed environments and avoid DINGTALK_OPERATOR_ID outside local debugging.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/shyzhen/skills/dingtalk-doc-enterprise)
- [DingTalk OpenClaw connector docs](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector?tab=readme-ov-file#%E9%92%89%E9%92%89%E6%96%87%E6%A1%A3docs%E4%B8%8E-mcpdocs)
- [Related DingTalk connector issue](https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector/issues/456)
- [Alternative ClawHub skill with write whitelist controls](https://clawhub.ai/shyzhen/dingtalk-doc)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with inline shell commands and command results]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Requires Node.js plus DINGTALK_CLIENTID and DINGTALK_CLIENTSECRET environment variables; operations are constrained to existing DingTalk document URLs or docKeys.]

## Skill Version(s):

1.0.8 (source: server evidence release.version)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to dingtalk-doc-enterprise and adjacent AI workflows.