
- Installs
- 189
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/larksuite/openclaw-lark --skill feishu-update-doc- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads feishu-update-doc automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
feishu__update_doc
更新飞书云文档内容,支持 7 种更新模式。优先使用局部更新(replace_range/append/insert_before/insert_after),慎用 overwrite(会清空文档重写,可能丢失图片、评论等)。
定位方式
定位模式(replace_range/replace_all/insert_before/insert_after/delete_range)支持两种定位方式,二选一:
selection_with_ellipsis - 内容定位
支持两种格式:
-
范围匹配:
开头内容...结尾内容- 匹配从开头到结尾的所有内容(包含中间内容)
- 建议 10-20 字符确保唯一性
-
精确匹配:
完整内容(不含...)- 匹配完整的文本内容
- 适合替换短文本、关键词等
转义说明:如果要匹配的内容本身包含 ...,使用 \.\.\. 表示字面量的三个点。
示例:
你好...世界→ 匹配从"你好"到"世界"之间的任意内容你好\.\.\.世界→ 匹配字面量 "你好...世界"
建议:如果文档中有多个 ...,建议使用更长的上下文来精确定位,避免歧义。
selection_by_title - 标题定位
格式:## 章节标题(可带或不带 # 前缀)
自动定位整个章节(从该标题到下一个同级或更高级标题之前)。
示例:
## 功能说明→ 定位二级标题"功能说明"及其下所有内容功能说明→ 定位任意级别的"功能说明"标题及其内容
可选参数
new_title
更新文档标题。如果提供此参数,将在更新文档内容后同步更新文档标题。
特性:
- 仅支持纯文本,不支持富文本格式
- 长度限制:1-800 字符
- 可以与任何 mode 配合使用
- 标题更新在内容更新之后执行
返回值
成功
{
"success": true,
"doc_id": "文档ID",
"mode": "使用的模式",
"message": "文档更新成功(xxx模式)",
"warnings": ["可选警告列表"],
"log_id": "请求日志ID"
}
异步模式(大文档超时)
{
"task_id": "async_task_xxxx",
"message": "文档更新已提交异步处理,请使用 task_id 查询状态",
"log_id": "请求日志ID"
}
使用返回的 task_id 再次调用 update-doc(仅传 task_id 参数)查询状态。
错误
{
"error": "[错误码] 错误消息\n💡 Suggestion: 修复建议\n📍 Context: 上下文信息",
"log_id": "请求日志ID"
}
使用示例
append - 追加到末尾
{
"doc_id": "文档ID或URL",
"mode": "append",
"markdown": "## 新章节\n\n追加的内容..."
}
replace_range - 定位替换
使用 selection_with_ellipsis:
{
"doc_id": "文档ID或URL",
"mode": "replace_range",
"selection_with_ellipsis": "## 旧章节标题...旧章节结尾。",
"markdown": "## 新章节标题\n\n新的内容..."
}
使用 selection_by_title(替换整个章节):
{
"doc_id": "文档ID或URL",
"mode": "replace_range",
"selection_by_title": "## 功能说明",
"markdown": "## 功能说明\n\n更新后的功能说明内容..."
}
replace_all - 全文替换
与 replace_range 类似,但支持多处同时替换(replace_range 要求匹配唯一):
{
"doc_id": "文档ID或URL",
"mode": "replace_all",
"selection_with_ellipsis": "张三",
"markdown": "李四"
}
返回值包含 replace_count 字段,表示替换的次数:
{
"success": true,
"replace_count": 4,
"message": "文档更新成功(replace_all模式,替换4处)"
}
注意:
- 与
replace_range不同,replace_all允许多个匹配 - 如果没有找到匹配内容,会返回错误
markdown可以为空字符串,表示删除所有匹配内容
insert_before - 前插入
{
"doc_id": "文档ID或URL",
"mode": "insert_before",
"selection_with_ellipsis": "## 危险操作...数据丢失风险。",
"markdown": "> **警告**:以下操作需谨慎!"
}
insert_after - 后插入
{
"doc_id": "文档ID或URL",
"mode": "insert_after",
"selection_with_ellipsis": "```python...```",
"markdown": "**输出示例**:\n```\nresult = 42\n```"
}
delete_range - 删除内容
使用 selection_with_ellipsis:
{
"doc_id": "文档ID或URL",
"mode": "delete_range",
"selection_with_ellipsis": "## 废弃章节...不再需要的内容。"
}
使用 selection_by_title(删除整个章节):
{
"doc_id": "文档ID或URL",
"mode": "delete_range",
"selection_by_title": "## 废弃章节"
}
注意:delete_range 模式不需要 markdown 参数。
同时更新标题和内容
可以在任何更新模式中添加 new_title 参数来同时更新文档标题:
{
"doc_id": "文档ID或URL",
"mode": "overwrite",
"markdown": "# 项目文档 v2.0\n\n全新的内容...",
"new_title": "项目文档 v2.0"
}
{
"doc_id": "文档ID或URL",
"mode": "append",
"markdown": "## 更新日志\n\n2025-12-18: 新增功能...",
"new_title": "项目文档(已更新)"
}
overwrite - 完全覆盖
⚠️ 会清空文档后重写,可能丢失图片、评论等,仅在需要完全重建文档时使用。
{
"doc_id": "文档ID或URL",
"mode": "overwrite",
"markdown": "# 新文档\n\n全新的内容..."
}
最佳实践
小粒度精确替换
修改文档内容时,定位范围越小越安全。尤其是表格、分栏等嵌套块,应精确定位到需要修改的文本,避免影响其他内容。
示例:表格单元格中有图片和文字,只需修改文字
- ❌ 替换整个表格或整行 → 可能破坏图片引用
- ✅ 只定位需要修改的文本 → 图片等其他内容不受影响
保护不可重建的内容
图片、画板、电子表格、多维表格、任务等内容以 token 形式存储,无法读出后原样写入。
保护策略:
- 替换时避开包含这些内容的区域
- 精确定位到纯文本部分进行修改
分步更新优于整体覆盖
修改多处内容时:
- ✅ 多次小范围替换,逐步修改
- ⚠️ 谨慎使用
overwrite重写整个文档, 除非你认为风险完全可控
原因:局部更新保留原有媒体、评论、协作历史,更安全可靠。
insert 模式扩大定位范围时注意插入位置
使用 insert_before 或 insert_after 时,如果目标内容重复出现,需要扩大 selection_with_ellipsis 范围来唯一定位。
关键:插入位置基于匹配范围的边界:
insert_after→ 插入在匹配范围的结尾之后insert_before→ 插入在匹配范围的开头之前
扩大范围时,确保边界仍然是期望的插入点。
修复画板语法错误
当 create-doc 或 update-doc 返回画板写入失败的 warning 时:
- warning 中包含 whiteboard 标签(如
<whiteboard token="xxx"/>) - 分析错误信息,修正 Mermaid/PlantUML 语法
- 用
replace_range替换:selection_with_ellipsis使用 warning 中的 whiteboard 标签,markdown提供修正后的代码块 - 重新提交验证
注意事项
- Markdown 语法:支持飞书扩展语法,详见 create-doc 工具文档
FAQ
What does the feishu-update-doc skill do?
更新飞书云文档。支持 7 种更新模式:追加、覆盖、定位替换、全文替换、前/后插入、删除。
How do I install feishu-update-doc?
Run npx skills add https://github.com/larksuite/openclaw-lark --skill feishu-update-doc in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/feishu-update-doc/ (personal) or .claude/skills/feishu-update-doc/ (project).
Which AI agents can use feishu-update-doc?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is feishu-update-doc safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains feishu-update-doc?
It is published by larksuite in larksuite/openclaw-lark. It has 189 recorded installs.
More from larksuite/openclaw-lark
feishu-bitable
larksuite/openclaw-lark
飞书多维表格(Bitable)的创建、查询、编辑和管理工具。包含 27 种字段类型支持、高级筛选、批量操作和视图管理。 当以下情况时使用此 Skill: (1) 需要创建或管理飞书多维表格 App (2) 需要在多维表格中新增、查询、修改、删除记录(行数据) (3) 需要管理字段(列)、视图、数据表 (4) 用户提到"多维表格"、"bitable"、"数据表"、"记录"、"字段" (5) 需要批量导入数据或批量更新多维表格
feishu-create-doc
larksuite/openclaw-lark
创建飞书云文档。从 Lark-flavored Markdown 内容创建新的飞书云文档,支持指定创建位置(文件夹/知识库/知识空间)。
feishu-im-read
larksuite/openclaw-lark
Open the skill to read its SKILL.md instructions.
feishu-calendar
larksuite/openclaw-lark
Open the skill to read its SKILL.md instructions.
feishu-fetch-doc
larksuite/openclaw-lark
Open the skill to read its SKILL.md instructions.
feishu-task
larksuite/openclaw-lark
Open the skill to read its SKILL.md instructions.
Popular productivity & automation skills
agent-browser
vercel-labs/agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.
lark-doc
open.feishu.cn
飞书云文档(Docx / Wiki)内容操作:读取、创建、编辑文档,插入或下载图片附件,以及操作思维笔记。用户提供文档 URL/token(包括 doubao.com 的 /docx/、/wiki/)时使用;按 URL 路径/token 而非域名路由;/page/ 是妙搭应用,非飞书云文档。文档内嵌资源按读取参考中的统一规则分流。独立评论操作走 lark-drive;随正文读取评论使用 docs +fetch。表格或 Base 内部数据操作不在本 skill。
lark-base
open.feishu.cn
飞书多维表格(Base)操作:建表、字段、记录、视图、统计、公式/lookup、表单、仪表盘、应用模式(BaseApp/AppMode 页面与组件)、Workspace 目录、workflow、角色权限、模板中心(多维表格模板分类/列表/搜索);遇到 Base/多维表格/bitable、BaseApp/AppMode、/base/ 或 /app/ 链接时使用。BaseApp 不走 lark-apps;文件导入/导出转 lark-drive,认证/授权转 lark-shared。
lark-drive
open.feishu.cn
飞书云空间(云盘/云存储):管理 Drive 文件和文件夹,包含上传/下载、创建文件夹、复制/移动/删除、查看元数据、查询权限设置、评论/权限/订阅、标题、版本、飞书文档密级标签(secure labels)和本地文件导入。用户需要整理云盘目录、处理云空间资源 URL/token、判断链接类型/真实 token/标题,或导入 Word/Markdown/Excel/CSV/PPTX/.base 为 docx/sheet/bitable/slides 时使用;doubao.com 云空间 URL/token 也按资源路径和 token 路由,不回退 WebFetch。不负责:文档内容编辑(走 lark-doc)、表格/Base 表内数据操作(走 lark-sheets/lark-base)、知识空间节点/成员管理(走 lark-wiki)、原生 Markdown 文件读写/patch/diff(走 lark-markdown)。
lark-shared
open.feishu.cn
Use for lark-cli setup/auth tasks: auth login/status/logout, user vs bot identity, business-domain permissions (--domain, including all/docs/drive), missing scopes, revoking authorization, or handling notice JSON.
lark-im
open.feishu.cn
飞书即时通讯:收发消息和管理群聊。发送和回复消息、搜索聊天记录、管理群聊成员、上传下载图片和文件、管理表情回复、发送应用内/短信/电话加急、发送和处理交互卡片(Interactive Card)、监听卡片按钮回调(card.action.trigger)。当用户需要发消息、查看或搜索聊天记录、下载聊天中的文件、查看群成员、搜索群、创建群聊或话题群、管理标记数据、管理 Feed 置顶(添加/移除/查询置顶会话)、管理标签数据、处理卡片回调时使用。