I. Skill Overview
This skill serves as the core document operation layer for the OpenClaw Feishu extension, activated when users reference Feishu documents, cloud docs, or docx links. It exposes a unified set of tool interfaces covering all common Feishu Doc operations, with full native support for Docx table creation & cell writing, plus image and file attachment upload capabilities.
II. Core Functional Capabilities
1. Token Extraction
Parse the unique document identifier from standard Feishu Doc URLs:
- URL Format:
https://xxx.feishu.cn/docx/ABC123def - Extracted Output:
doc_token = ABC123def
2. Document Read Operation
json
{ "action": "read", "doc_token": "ABC123def" }
Returned payload includes document title, plaintext content, and block type statistics. If the response contains a
hint field, structured content (tables, images, etc.) exists within the document; invoke list_blocks to retrieve full detailed structured data.3. Full Document Overwrite Write
json
{ "action": "write", "doc_token": "ABC123def", "content": "# Title\n\nMarkdown content..." }
Replaces the entire document body with input Markdown. Supported Markdown elements: headings, bullet/numbered lists, code blocks, blockquotes, hyperlinks, embedded images (
Limitation: Markdown table syntax is unsupported.
 auto-triggers image upload), bold, italic, strikethrough text.
4. Append Content to Document End
json
{ "action": "append", "doc_token": "ABC123def", "content": "Additional content" }
Inserts supplied Markdown content at the bottom of the target document.
5. New Document Creation
Basic creation syntax:
json
{ "action": "create", "title": "New Document", "owner_open_id": "ou_xxx" }
Specify target parent folder with
folder_token:json
{ "action": "create", "title": "New Document", "folder_token": "fldcnXXX", "owner_open_id": "ou_xxx" }
Critical Mandatory Rule: The
owner_open_id parameter (pulled from inbound request metadata sender_id) must be provided. If omitted, only the bot application gains document access, and the end user cannot view the generated document.6. Granular Block-Level Operations
| Operation | Description |
|---|---|
| list_blocks | Returns complete raw block dataset including tables and images for structured content parsing |
| get_block | Fetch full detailed metadata for a single specified block |
| update_block | Modify text content of a target block |
| delete_block | Permanently remove a specified block from the document |
7. Docx Table Block Dedicated Operations
| Operation | Description |
|---|---|
| create_table | Initialize an empty table with defined row/column counts, configurable fixed column widths |
| write_table_cells | Batch inject cell values into an existing table |
| create_table_with_values | One-step workflow to generate a table and populate all cell data in a single call |
All table operations accept an optional
parent_block_id parameter to insert the table as a child of a designated parent block.8. Image Upload Workflow
Upload images via remote public URL:
json
{ "action": "upload_image", "doc_token": "ABC123def", "url": "https://example.com/image.png" }
Upload local file with positional insertion control:
json
{ "action": "upload_image", "doc_token": "ABC123def", "file_path": "/tmp/image.png", "parent_block_id": "doxcnParent", "index": 5 }
index: Zero-based integer defining insertion order among sibling blocks; omitted values append the image to the document bottom.Display Note: Rendered image size is determined by native pixel dimensions. Small assets (e.g. 480×270 GIFs) must be scaled to a minimum width of 800px prior to upload to guarantee normal visible rendering.
9. File Attachment Upload Workflow
Upload attachments via remote URL source:
json
{ "action": "upload_file", "doc_token": "ABC123def", "url": "https://example.com/report.pdf" }
Upload local file with custom filename override:
json
{ "action": "upload_file", "doc_token": "ABC123def", "file_path": "/tmp/report.pdf", "filename": "Q1-report.pdf" }
Enforced Upload Rules:
- Exactly one source parameter (
urlorfile_path) must be supplied; simultaneous dual input is prohibited. - Optional
filenamefield overrides the default stored file display name. - Optional
parent_block_iddefines the target parent block for attachment embedding.
III. Standard Document Read Workflow
- Execute
action: "read"to retrieve plaintext body and high-level block statistics - Inspect returned
block_typesto detect structured elements (Tables, Images, Code blocks, etc.) - If structured content exists, run
action: "list_blocks"to pull complete raw structured block data
IV. Configuration Snippet
yaml
channels:
feishu:
tools:
doc: true # Default enabled state: true
Dependency Note: The
feishu_wiki skill relies entirely on this tool; all Wiki page read/write logic is powered by the feishu_doc operation layer.V. Required API Permission Scopes
docx:documentdocx:document:readonlydocx:document.block:convertdrive:drive
VI. Primary Applicable Use Cases
- Feishu Document Content Retrieval: Extract document titles, body text, and block statistics for downstream analysis and automated processing pipelines
- Automated Document Creation: Generate new Feishu Doc instances with guaranteed full end-user access permissions
- Bulk Write & Incremental Append: Batch replace full document bodies via Markdown input, or append supplementary content to existing docs
- Structured Table Management: Create empty tables, batch populate cell datasets, or initialize pre-filled tables in one atomic operation
- Media & Attachment Embedding: Upload images and arbitrary file attachments to precise target positions within Feishu Docs
- Fine-Grained Block Editing: Isolate, modify, or delete individual discrete blocks inside a document
- Wiki Page Backend Dependency: Acts as the underlying data layer for the
feishu_wikiskill to enable full Wiki page read/write functionality
VII. Critical Governing Principles
- Mandatory
owner_open_idfor document creation: Omission restricts document visibility exclusively to the bot application, blocking end user access. - Markdown table syntax unsupported: Tables cannot be generated via standard Markdown write actions; dedicated table operation endpoints must be used instead.
- Pre-scale small image assets: Resize narrow visual assets to a minimum 800px width before upload to avoid broken rendering.
- Two-stage structured content retrieval: The
readaction only returns a hint flag for tables/images; full structured data requires a subsequentlist_blockscall. - Mutually exclusive file upload sources: Only one of
urlorfile_pathmay be specified per upload request.
VIII. Summary
Feishu Doc is the foundational document manipulation skill powering OpenClaw’s Feishu integration extension. The unified
feishu_doc tool delivers full CRUD functionality for Feishu Docx files: full document reading, overwrites, incremental appends, new document generation, structured table operations, media/file attachment uploads, and precise block-level editing. It functions both as a standalone tool for direct Feishu Doc automation and a mandatory backend dependency for the feishu_wiki skill to support Wiki content workflows. Built for end-to-end automated document management within the Feishu ecosystem, it constitutes the core content processing layer of OpenClaw’s Feishu platform integration.