飞书文档同步

SKILL研究检索

原名 feishu-doc-sync

研究检索 联网访问 许可证明确 OpenClaw
安装这个技能

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

累计安装 11,975 本周 494
GitHub 星标 未标注 仓库 feishu-doc-sync
下载量 3,912 技能市场下载数
权限级别 联网访问 安装前请确认风险范围
许可证 许可证明确 MIT-0

安装

ClawHub 市场
在支持 Skills 的客户端里执行,装完问一句「你有哪些技能」验证
openclaw skills install feishu-doc-sync

技能档案

研究检索
字段来自技能仓库与公开索引,中文说明由本站标注
作者 / 维护方deadblue22仓库 feishu-doc-sync · 版本 1.0.0
宿主客户端OpenClaw技能可被这些客户端加载
安装方式ClawHub 市场安装包 deadblue22/feishu-doc-sync
权限级别联网访问安装前请确认风险范围
许可证MIT-0许可证明确,商用前请自行确认条款
仓库可用性available技能仓库当前是否可访问
最近核验2026-05-01上游最后核验时间 · 数据更新 未标注
正文体量10.7 KBSKILL.md 原文大小,越大说明说明书写得越细

能做什么

5 项能力
上游给出的能力概览与适用场景
  • 按任务关键词查找相关 Skills
  • 展示可复制的安装命令
  • 保留来源站点、仓库和原始说明,方便继续核验
  • 补充不同宿主或平台的使用分布数据
  • 展示第三方安全扫描或审计结果
OpenClaw 用户查找和安装 Skill 时用户想查找某类 Agent Skill 时需要根据任务场景推荐可安装能力包时需要对比不同来源的安装命令和来源信息时

权限与风险

联网访问
装之前先读完这段

安装与使用指南

安装步骤

本站只展示命令,不托管安装包,也不自动执行。

怎么用

安装后应在对应宿主中按原始 README 的触发条件使用;当前草稿只做目录说明,具体调用方式由规则抽取,异常条目再复核。

SKILL.md 全文

10.7 KB
模型实际读到的说明书原文,来自技能仓库

Feishu Document Tool

Single tool feishu_doc with action parameter for all document operations, including table creation for Docx.

Token Extraction

From URL https://xxx.feishu.cn/docx/ABC123def → doc_token = ABC123def

Actions

Read Document

{ "action": "read", "doc_token": "ABC123def" }

Returns: title, plain text content, block statistics. Check hint field — if present, structured content (tables, images) exists that requires list_blocks.

Write Document (Replace All)

{ "action": "write", "doc_token": "ABC123def", "content": "# Title\
\
Markdown content..." }

Replaces entire document with markdown content. Supports: headings, lists, code blocks, quotes, links, images (![](url) auto-uploaded), bold/italic/strikethrough, and Markdown tables.

Append Content

{ "action": "append", "doc_token": "ABC123def", "content": "Additional content" }

Appends markdown to end of document. Supports the same content types as write, including Markdown tables.

Insert Content (Positioned)

{
  "action": "insert",
  "doc_token": "ABC123def",
  "after_block_id": "doxcnXXX",
  "content": "Markdown content including tables..."
}

Inserts content after a specific block. Uses Descendant API internally, supports all block types including tables.

Key usage: This is the primary way to insert content at a precise position. Use list_blocks first to find the after_block_id.

Create Document

{ "action": "create", "title": "New Document", "owner_open_id": "ou_xxx" }

With folder:

{
  "action": "create",
  "title": "New Document",
  "folder_token": "fldcnXXX",
  "owner_open_id": "ou_xxx"
}

Important: Always pass owner_open_id with the requesting user's open_id (from inbound metadata sender_id) so the user automatically gets full_access permission on the created document. Without this, only the bot app has access.

List Blocks

{ "action": "list_blocks", "doc_token": "ABC123def" }

Returns full block data including tables, images. Use this to read structured content and find block IDs for positioning.

Get Single Block

{ "action": "get_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }

Update Block Text

{
  "action": "update_block",
  "doc_token": "ABC123def",
  "block_id": "doxcnXXX",
  "content": "New text with **bold** and `code`"
}

Supports Markdown inline styles: **bold**, `code`, [link](url), ~~strike~~.

Supported block types: Text, Heading, Bullet, Ordered, Code, Quote, Todo.

⚠️ NOT for tables: Using update_block on a table cell replaces content as plain text, destroying all inline formatting (inline_code, bold, etc.).

Delete Block

{ "action": "delete_block", "doc_token": "ABC123def", "block_id": "doxcnXXX" }

Create Table

{
  "action": "create_table",
  "doc_token": "ABC123def",
  "row_size": 2,
  "column_size": 2,
  "column_width": [200, 200]
}

⚠️ Positioning unreliable: parent_block_id and index parameters do not work correctly for tables — tables always end up at the document end. Use insert action with after_block_id instead for positioned tables.

Write Table Cells

{
  "action": "write_table_cells",
  "doc_token": "ABC123def",
  "table_block_id": "doxcnTABLE",
  "values": [
    ["A1", "B1"],
    ["A2", "B2"]
  ]
}

Writes plain text into table cells. Supports Markdown inline styles in cell values.

Note: This clears and rebuilds cell children. Suitable for initial table filling or full-cell replacement, but not for partial cell edits.

Create Table With Values (One-step)

{
  "action": "create_table_with_values",
  "doc_token": "ABC123def",
  "row_size": 2,
  "column_size": 2,
  "column_width": [200, 200],
  "values": [["A1", "B1"], ["A2", "B2"]]
}

⚠️ Same positioning caveat as create_table — use insert action for positioned tables.

Table Row/Column Operations

{ "action": "insert_table_row", "doc_token": "...", "table_block_id": "...", "row_index": -1 }
{ "action": "insert_table_column", "doc_token": "...", "table_block_id": "...", "column_index": -1 }
{ "action": "delete_table_rows", "doc_token": "...", "block_id": "...", "row_start": 1, "row_count": 1 }
{ "action": "delete_table_columns", "doc_token": "...", "block_id": "...", "column_start": 0, "column_count": 1 }
{ "action": "merge_table_cells", "doc_token": "...", "table_block_id": "...", "row_start": 0, "row_end": 2, "column_start": 0, "column_end": 2 }

Note for delete_table_rows: Uses block_id (not table_block_id), row_start (not row_index).

Upload Image

{ "action": "upload_image", "doc_token": "ABC123def", "url": "https://example.com/image.png" }

Or local path with position control:

{
  "action": "upload_image",
  "doc_token": "ABC123def",
  "file_path": "/tmp/image.png",
  "parent_block_id": "doxcnParent",
  "index": 5
}

Or base64 data URI:

{
  "action": "upload_image",
  "doc_token": "ABC123def",
  "image": "data:image/png;base64,iVBOR..."
}

Note: Image display size is determined by the uploaded image's pixel dimensions. For small images (e.g. 480x270), scale to 800px+ width before uploading.

Upload File Attachment

{ "action": "upload_file", "doc_token": "ABC123def", "url": "https://example.com/report.pdf" }

Or local path:

{ "action": "upload_file", "doc_token": "ABC123def", "file_path": "/tmp/report.pdf", "filename": "Q1-report.pdf" }

Color Text

{
  "action": "color_text",
  "doc_token": "ABC123def",
  "block_id": "doxcnXXX",
  "content": "colored text",
  "color": "red"
}

Reading Workflow

  1. Start with action: "read" — get plain text + statistics
  2. Check block_types in response for Table, Image, Code, etc.
  3. If structured content exists, use action: "list_blocks" for full data

Incremental Sync Best Practices

When to Use Incremental vs Full Sync

  • < 5 blocks changed → incremental (delete + insert individual blocks)
  • > 80% blocks changed → full sync (write action to replace all)
  • Single table changed → delete old table + insert new table

Table Update Strategy: Delete + Insert

Tables should NEVER be edited in-place. Always:

1. list_blocks → find the block before the table (anchor_block_id)
2. delete_block(block_id = old_table_id)
3. insert(after_block_id = anchor_block_id, content = &quot;| new | table |...&quot;)

Why not edit in-place?
- update_block on table cell → strips inline formatting (inline_code, bold, links all become plain text)
- write_table_cells → clears and rebuilds cell children, similar formatting loss
- create_table / create_table_with_values → positioning unreliable

Multi-Block Batch Replacement

When changes span multiple consecutive blocks:

  1. Find anchor (last unchanged block before the changed region)
  2. Delete changed blocks in reverse order (to avoid index drift)
  3. Single insert call with all new content (supports mixed block types)

Diff Strategy (from feishu-doc-sync)

  1. Block signature matching — (type, content) hash for alignment, style hash for change detection
  2. LCS alignment of local ↔ remote blocks
  3. Three-phase execution: UPDATE (text blocks) → DELETE (reverse order) → INSERT (forward order)
  4. Tables: if structure is identical, cell-level diff is possible; if structure differs, full table replacement
  5. When change rate > 80%, fall back to full sync

Table Header Row (Dark Background)

The header_row: true property gives tables a dark header background. This is a common requirement.

⚠️ Critical: header_row can ONLY be set at creation time

The PATCH API (update_table_property) does NOT work for header_row — it returns code: 0 (success) but silently fails to apply the property. This applies to both single-block PATCH and batch_update.

How to Create Tables with Header Row

Since insert action (Descendant API) and create_table action do not support header_row, you must use the raw Feishu API:

# Step 1: Get tenant_access_token
TOKEN=$(curl -s https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal \
  -H &quot;Content-Type: application/json&quot; \
  -d &#x27;{&quot;app_id&quot;:&quot;&#x27;$APP_ID&#x27;&quot;,&quot;app_secret&quot;:&quot;&#x27;$APP_SECRET&#x27;&quot;}&#x27; \
  | python3 -c &quot;import json,sys; print(json.load(sys.stdin)[&#x27;tenant_access_token&#x27;])&quot;)

# Step 2: Create empty table with header_row via document_block_children.create
curl -s -X POST \
  &quot;https://open.feishu.cn/open-apis/docx/v1/documents/{doc_token}/blocks/{doc_token}/children?document_revision_id=-1&quot; \
  -H &quot;Authorization: Bearer $TOKEN&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#x27;{
    &quot;children&quot;: [{
      &quot;block_type&quot;: 31,
      &quot;table&quot;: {
        &quot;property&quot;: {
          &quot;row_size&quot;: 3,
          &quot;column_size&quot;: 2,
          &quot;header_row&quot;: true,
          &quot;column_width&quot;: [300, 400]
        }
      }
    }],
    &quot;index&quot;: 5
  }&#x27;

# Step 3: Fill cells via feishu_doc write_table_cells
# (use the new table&#x27;s block_id from step 2 response)

Credentials: Read from /root/.openclaw/openclaw.json → channels.feishu.appId / channels.feishu.appSecret.

Workflow for Positioned Table with Header Row

  1. list_blocks → find the anchor block and target index
  2. (If replacing) delete_block → remove old table
  3. Raw API document_block_children.create → create empty table with header_row: true at correct index
  4. feishu_doc write_table_cells → fill content
  5. Verify: get_block → check table.property.header_row

Column Width Algorithm

Auto-calculated when using insert action (Descendant API):
- Total width: ~730px
- CJK characters count as 2x width
- Per-column: proportional distribution, clamped to 50–400px
- When using raw API, specify column_width manually


Sync Prerequisites

  • Always git pull before reading local repo files — ensures latest content
  • Compare before writing — use read or list_blocks to check current state
  • Preserve formatting — inline_code, bold, links in table cells require careful handling

Configuration

channels:
  feishu:
    tools:
      doc: true  # default: true

Note: feishu_wiki depends on this tool — wiki page content is read/written via feishu_doc.

Permissions

Required: docx:document, docx:document:readonly, docx:document.block:convert, drive:drive

安全信息

审计结论
未标注不代表已通过审计
安全审计VirusTotal、ClawScan、Static analysis第三方安全审计平台给出的结论

热门专题

按场景挑技能
全部专题 →

技能内容以作者仓库为准;分类、权限级别与许可证状态的中文说明为中文整理,最近核验 2026-05-01。