一键导入
feishu-document-manage
飞书文档管理(创建、读取、编辑、删除)。触发词:飞书文档、文档、docx、知识库、wiki、创建文档、编辑文档、写文档、读文档、文档内容、追加内容、删除块。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
飞书文档管理(创建、读取、编辑、删除)。触发词:飞书文档、文档、docx、知识库、wiki、创建文档、编辑文档、写文档、读文档、文档内容、追加内容、删除块。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
获取飞书聊天记录并总结。触发词:获取聊天记录、总结聊天、聊天历史、chat history、获取消息、拉取记录、所有消息、全部记录。必须使用 feishu_get_chat_history 工具,禁止使用 browser。
项目管理冷启动。当机器人首次或重新加入群聊时,拉取历史消息、建立群记忆、生成初始项目总结。触发词:冷启动、初始化项目、读取历史记录、生成初始总结、项目上下文初始化。
上传文件到飞书云空间。支持单文件上传(<=20MB)和分片上传(>20MB)。触发词:上传文件、传到飞书、飞书上云、文件上传。
群组记忆管理。触发词:理解上下文、回顾讨论、群组记忆、优化记忆、之前说了什么、聊了什么。
项目管理配置。触发词:启动项目管理、关闭项目、设置总结周期、每周总结、定期汇报、项目配置。
管理群组/项目的成员角色配置。触发词:设置角色、配置测试人员、项目成员、成员角色、谁是测试、谁是开发、角色管理。
| name | feishu-document-manage |
| description | 飞书文档管理(创建、读取、编辑、删除)。触发词:飞书文档、文档、docx、知识库、wiki、创建文档、编辑文档、写文档、读文档、文档内容、追加内容、删除块。 |
| metadata | {"openclaw":{"emoji":"📄","requires":{"config":["channels.feishu"]}}} |
本 Skill 指导你使用 feishu_document 和 feishu_get_document_content 工具管理飞书文档。
feishu_get_document_content(更简洁,支持 text/markdown 输出)feishu_document| action | 说明 | 必需参数 |
|---|---|---|
| create | 创建空文档 | title,可选 folder_token |
| get | 获取文档元数据 | document_id |
| get_raw_content | 获取文档纯文本 | document_id |
| list_blocks | 获取文档所有块 | document_id,可选 format(json/text/markdown) |
| get_block | 获取指定块 | document_id + block_id |
| get_children | 获取子块列表 | document_id + block_id |
| create_blocks | 在父块下创建子块 | document_id + block_id + children,可选 index |
| create_nested | 创建嵌套块(含子块的子块) | document_id + block_id + children,可选 index |
| update_block | 更新块内容 | document_id + block_id + update_body |
| batch_update | 批量更新块 | document_id + requests |
| delete_blocks | 删除子块 | document_id + block_id + start_index + end_index |
| add_permission | 添加协作者权限 | document_id + member_type + member_id + perm,可选 doc_type/need_notification |
| update_permission | 更新协作者权限 | document_id + member_type + member_id + perm |
| remove_permission | 移除协作者 | document_id + member_type + member_id |
| list_permissions | 获取协作者列表 | document_id |
| transfer_owner | 转移文档所有权 | document_id + owner_type + owner_id |
document_id 支持传入飞书文档 URL,自动解析。
| 值 | 说明 |
|---|---|
| openid | 用户 open_id(最常用) |
| userid | 用户 user_id |
| unionid | 用户 union_id |
| 用户邮箱 | |
| openchat | 群组 chat_id(给整个群授权) |
| opendepartmentid | 部门 ID |
| groupid | 自定义用户组 ID |
| wikispaceid | 知识库 ID |
| 值 | 说明 |
|---|---|
| view | 可阅读 |
| edit | 可编辑 |
| full_access | 可管理(含权限管理) |
权限操作时需要指定文档类型,默认 docx。如操作其他类型,需显式传入:
| 值 | 说明 |
|---|---|
| docx | 新版文档(默认) |
| doc | 旧版文档 |
| sheet | 电子表格 |
| bitable | 多维表格 |
| folder | 文件夹 |
| file | 文件 |
| wiki | 知识库节点 |
给用户添加编辑权限:
feishu_document add_permission (
document_id="https://xxx.feishu.cn/docx/xxxxx",
member_type="openid",
member_id="ou_xxx",
perm="edit"
)
给整个群授权阅读:
feishu_document add_permission (
document_id=xxx,
member_type="openchat",
member_id="oc_xxx",
perm="view"
)
查看文档的所有协作者:
feishu_document list_permissions (document_id=xxx)
转移文档所有权:
feishu_document transfer_owner (
document_id=xxx,
owner_type="openid",
owner_id="ou_xxx"
)
| block_type 值 | 类型 | 说明 |
|---|---|---|
| 1 | Page | 页面(根块,自动创建,不可手动添加) |
| 2 | Text | 文本 |
| 3 | Heading1 | 一级标题 |
| 4 | Heading2 | 二级标题 |
| 5 | Heading3 | 三级标题 |
| 6 | Heading4 | 四级标题 |
| 7 | Heading5 | 五级标题 |
| 8 | Heading6 | 六级标题 |
| 9 | Heading7 | 七级标题 |
| 10 | Heading8 | 八级标题 |
| 11 | Heading9 | 九级标题 |
| 12 | Bullet | 无序列表 |
| 13 | Ordered | 有序列表 |
| 14 | Code | 代码块 |
| 15 | Quote | 引用 |
| 17 | Todo | 待办事项 |
| 18 | Bitable | 多维表格 |
| 19 | Callout | 高亮块 |
| 20 | ChatCard | 会话卡片 |
| 21 | Diagram | 流程图/UML |
| 22 | Divider | 分割线 |
| 23 | File | 文件 |
| 24 | Grid | 分栏 |
| 25 | GridColumn | 分栏列 |
| 27 | Image | 图片 |
| 28 | ISV | 第三方小组件 |
| 30 | Mindnote | 思维笔记 |
| 31 | Sheet | 电子表格 |
| 32 | Table | 表格 |
| 33 | TableCell | 表格单元格 |
| 34 | View | 视图 |
| 35 | QuoteContainer | 引用容器 |
| 37 | Task | 任务 |
| 38 | OKR | OKR |
| 39 | OkrObjective | OKR 目标 |
| 40 | OkrKeyResult | OKR 关键结果 |
| 41 | OkrProgress | OKR 进展 |
| 99 | Undefined | 未定义 |
文本类块(Text、Heading、Bullet、Ordered、Code、Quote、Todo)的内容都通过 elements 数组定义。每个 element 是一个 TextElement:
{
"text_run": {
"content": "这是文本内容",
"text_element_style": {
"bold": true,
"italic": false,
"underline": false,
"strikethrough": false,
"inline_code": false
}
}
}
也支持其他 element 类型:
mention_user: 提及用户 { "user_id": "ou_xxx", "text_element_style": {} }mention_doc: 提及文档 { "token": "xxx", "obj_type": 1, "text_element_style": {} }equation: 公式 { "content": "E=mc^2" }{
"block_type": 2,
"text": {
"elements": [
{ "text_run": { "content": "这是一段普通文本" } }
]
}
}
{
"block_type": 4,
"heading2": {
"elements": [
{ "text_run": { "content": "二级标题内容" } }
]
}
}
{
"block_type": 12,
"bullet": {
"elements": [
{ "text_run": { "content": "列表项内容" } }
]
}
}
{
"block_type": 13,
"ordered": {
"elements": [
{ "text_run": { "content": "有序列表项" } }
]
}
}
{
"block_type": 14,
"code": {
"elements": [
{ "text_run": { "content": "console.log('hello');" } }
],
"style": {
"language": 18,
"wrap": true
}
}
}
常用语言编号:1=PlainText, 4=Python, 18=JavaScript, 19=TypeScript, 22=Go, 40=Java, 43=JSON, 49=Bash
{
"block_type": 17,
"todo": {
"elements": [
{ "text_run": { "content": "需要完成的事项" } }
],
"style": {
"done": false
}
}
}
{
"block_type": 22,
"divider": {}
}
表格通过 create_blocks 创建,指定行列数:
{
"block_type": 32,
"table": {
"property": {
"row_size": 3,
"column_size": 2
}
}
}
创建后会自动生成 TableCell 子块,通过 update_block 编辑单元格内容。
{
"block_type": 19,
"callout": {
"background_color": 2,
"border_color": 2,
"emoji_id": "bulb"
}
}
高亮块创建后,通过 create_blocks 往里面添加文本子块。
{
"update_text_elements": {
"elements": [
{ "text_run": { "content": "新的文本内容" } }
]
}
}
插入行:
{
"insert_table_row": {
"row_index": 2
}
}
插入列:
{
"insert_table_column": {
"column_index": 1
}
}
删除行:
{
"delete_table_rows": {
"row_start_index": 1,
"row_end_index": 2
}
}
合并单元格:
{
"merge_table_cells": {
"row_start_index": 0,
"row_end_index": 1,
"column_start_index": 0,
"column_end_index": 1
}
}
插入分栏列:
{
"insert_grid_column": {
"column_index": 1
}
}
1. feishu_document create (title="项目周报")
→ 拿到 document_id
2. feishu_document create_blocks (
document_id=<上面的 ID>,
block_id=<与 document_id 相同,即根块>,
children=[
{ "block_type": 3, "heading1": { "elements": [{ "text_run": { "content": "本周进展" } }] } },
{ "block_type": 2, "text": { "elements": [{ "text_run": { "content": "完成了 xxx 功能开发..." } }] } },
{ "block_type": 22, "divider": {} },
{ "block_type": 3, "heading1": { "elements": [{ "text_run": { "content": "下周计划" } }] } },
{ "block_type": 12, "bullet": { "elements": [{ "text_run": { "content": "完成 yyy 联调" } }] } },
{ "block_type": 12, "bullet": { "elements": [{ "text_run": { "content": "启动 zzz 评审" } }] } }
]
)
简单读取(推荐):
feishu_get_document_content (document="https://xxx.feishu.cn/docx/xxxxx", format="markdown")
获取块结构(需要编辑时):
feishu_document list_blocks (document_id="https://xxx.feishu.cn/docx/xxxxx", format="json")
1. feishu_document create_blocks (
document_id=<文档 ID>,
block_id=<与 document_id 相同>,
children=[
{ "block_type": 2, "text": { "elements": [{ "text_run": { "content": "追加的内容" } }] } }
]
)
→ 不传 index 默认追加到末尾
1. feishu_document list_blocks (document_id=xxx, format="json")
→ 找到目标块的 block_id
2. feishu_document update_block (
document_id=xxx,
block_id=<目标块 ID>,
update_body={
"update_text_elements": {
"elements": [{ "text_run": { "content": "替换后的文本" } }]
}
}
)
1. feishu_document get_children (document_id=xxx, block_id=<父块 ID>)
→ 查看子块列表和索引
2. feishu_document delete_blocks (
document_id=xxx,
block_id=<父块 ID>,
start_index=2,
end_index=4
)
→ 删除索引 2 到 4 的子块
创建文档时,工具可自动授予指定用户 full_access(可管理) 权限。默认协作者列表不得写在 Skill 描述或代码明文里,应通过以下方式之一配置:
defaultCollaborators(或等价项),格式为 [{ "member_name": "显示名", "open_id": "ou_xxx" }]。FEISHU_DOC_DEFAULT_COLLABORATORS 为 JSON 数组,避免在 Skill 或仓库中暴露 open_id。未配置时,创建文档后需手动在飞书内添加协作者,或调用 add_permission 为指定用户授权。
list_blocks (format="json") 或 get_block 了解现有结构docx,如果操作的是电子表格、知识库等其他类型文档,要传正确的 doc_type