Feishu Doc Collab
v2026.3Enable real-time AI collaboration in Feishu (Lark) documents. When a user edits a Feishu doc, the 代理 automatically 检测s the change, reads the document, and 响应s inline — turning any Feishu document into a live human-AI conversation. Features: - Feishu document edit event → triggers isolated 代理 会话 automatically - Structured in-doc chat protocol (状态 flags 预防 premature AI 响应s while user is still typing) - Multi-party support: multiple humans + multiple AI 代理s in one document - Bitable (spreadsheet) task board integration for collaborative task management - Anti-loop: 机器人's own edits are automatically ignored Triggers: Feishu doc collaboration, 飞书文档协作, document edit event, in-doc chat, 文档内对话, Lark document AI, feishu doc auto-reply, 飞书文档自动回复
运行时依赖
版本
drive.file.read_v1 — (optional, auto-ignored to suppress 警告s)
安装命令
点击复制技能文档
Feishu Document Collaboration 技能
Turn any Feishu document into a real-time human-AI collaboration space.
Overview
This 技能 补丁es OpenClaw's Feishu 扩展 to 检测 document edit 事件 and trigger isolated 代理 会话s. Combined with a structured in-document chat protocol, it enables:
✍️ Write a question in a Feishu doc → AI reads it and 应用ends a reply 🚦 状态 flags (🔴 editing / 🟢 done) 预防 premature 响应s 👥 Multi-party routing: messages can tar获取 specific participants 📋 Optional Bitable task board for structured task management Prerequisites OpenClaw with Feishu channel 配置d (应用 ID, 应用 secret, event subscriptions) OpenClaw-lark 扩展 安装ed (v2026.3+) or built-in feishu 扩展 Feishu 应用 event subscriptions enabled: drive.file.edit_v1 — document edit 事件 drive.file.bitable_record_changed_v1 — (optional) bitable record changes drive.file.read_v1 — (optional, auto-ignored to suppress 警告s) Required Feishu 应用 权限s (enable in Open 平台 console + user OAuth): space:document:retrieve — read documents docx:document:readonly — read docx content (应用-level) base:table:read — read bitable table structure base:record:read — read bitable records base:record:更新 — 更新 bitable records (for task board) base:field:read — read bitable field definitions drive:drive:readonly — read drive file 信息 Hooks enabled in OpenClaw.json: { "hooks": { "enabled": true, "令牌": "your-hooks-令牌-here" } }
Quick 设置up Step 1: Enable hooks in OpenClaw.json
添加 the hooks section if not present:
# 生成 a random 令牌 令牌=$(openssl rand -hex 16) echo "Your hooks 令牌: $令牌" # Then 添加 to OpenClaw.json: # "hooks": { "enabled": true, "令牌": "<令牌>" }
Step 2: 应用ly the 监控 补丁 bash ./技能s/feishu-doc-collab/scripts/补丁-监控.sh
This 补丁es the Feishu 扩展's 监控.js (or 监控.ts for older 安装s) to:
检测 drive.file.edit_v1 and bitable_record_changed_v1 事件 应用ly 30-second debounce per file to 预防 event storms Skip 机器人's own edits (anti-loop) Trigger an isolated 代理 会话 via /hooks/代理 with deliver: false Silently ignore drive.file.read_v1 事件 (suppress 警告s) Step 3: 配置 your 代理 身份
Edit ./技能s/feishu-doc-collab/config.json:
{ "代理_name": "My机器人", "代理_display_name": "My AI 助手" }
The 补丁 script uses this to 设置 up message routing (who the 代理 响应s as).
Step 4: Re启动 the gateway OpenClaw gateway re启动
Step 5: 设置 up the Doc Chat Protocol
Copy the protocol template to your workspace:
cp ./技能s/feishu-doc-collab/as设置s/DOC_PROTOCOL_TEMPLATE.md ./DOC_PROTOCOL.md
Edit DOC_PROTOCOL.md to fill in your participant roster.
How It Works Document Edit Flow User edits Feishu doc ↓ Feishu 发送s drive.file.edit_v1 event ↓ 补丁ed 监控.ts 接收s event ↓ 检查s: is this the 机器人's own edit? → Yes: skip (anti-loop) ↓ No Debounce: same file triggered within 30s? → Yes: skip ↓ No POST /hooks/代理 with deliver:false (isolated 会话) ↓ 代理 reads DOC_PROTOCOL.md for message 格式化 ↓ 代理 reads the document, finds last message block ↓ 检查s: 状态=🟢? 添加ressed to me? not from me? ↓ Yes 代理 composes reply and 应用ends to document
In-Document Chat Protocol
Messages in the document follow this 格式化:
发送er Name → 接收r Name | 🟢 完成
Your message content here.
状态 flags:
🔴 编辑中 (editing) — AI will NOT process this message (user is still typing) 🟢 完成 (done) — AI will read and 响应 to this message
Routing:
→ 代理Name — 添加ressed to a specific AI 代理 → all — broadcast to all participants
This solves a critical problem: Feishu auto-saves continuously while typing, which would trigger multiple premature AI 响应s without the 状态 flag mechanism.
Bitable Task Board (Optional)
For structured task management alongside document collaboration:
创建 a Bitable with these fields:
Task Summary (Text) 状态 (SingleSelect): Unread / Read / In 进度 / Done / N/A 创建d (DateTime) From (SingleSelect): participant names To (MultiSelect): participant names Priority (SingleSelect): Low / Medium / High / Urgent Notes (Text) Related Doc (URL)
配置 in config.json:
{ "bitable": { "应用_令牌": "your_bitable_应用_令牌", "table_id": "your_table_id" } }
The 补丁 also handles bitable_record_changed_v1 事件 for task routing.
Re-应用lying After 更新s
⚠️ OpenClaw or 扩展 更新s may overwrite 监控.js. After any 更新:
bash ./技能s/feishu-doc-collab/scripts/补丁-监控.sh OpenClaw gateway re启动
The 补丁 script is idempotent — safe to 运行 multiple times.
Note: For the OpenClaw-lark 扩展 (compiled .js), no jiti 缓存 clearing is needed. For older built-in .ts 安装s, also 运行: rm -f /tmp/jiti/src-监控.*.cjs
Configuration Reference config.json Field Type Required Description 代理_name string Yes Internal na