mcpField
F
feishu-doc-optimizer

feishu-doc-optimizer

github.com/aaaaqwqDocuments11152 installsUpdated 1w ago
Repository

About feishu-doc-optimizer

feishu-doc-optimizer is a skill for improving the structure, layout, and presentation of Feishu cloud documents. It reads document content, revises it, then uses browser automation to replace the existing text.

Key features

  1. 01Read documents through the Feishu API
  2. 02Restructure sections and content hierarchy
  3. 03Condense text and standardize tables and dividers
  4. 04Replace document content through Playwright browser automation

Use cases

  1. 01Organize sections and navigation in project documents
  2. 02Remove redundancy and highlight key information
  3. 03Standardize headings, tables, and visual markers
  4. 04Write optimized content back to Feishu documents

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aaaaqwq/agi-super-team --skill feishu-doc-optimizer

After installing, type/feishu-doc-optimizerin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
optimization-examples.md
scripts/
feishu_doc_editor.py
feishu_doc_reader.py

Details

From the project README

飞书云文档优化器

优化飞书云文档的内容结构、排版格式和视觉美观度。

工作流程

1. 读取文档内容

使用飞书 API 读取文档原始内容:

python3 scripts/feishu_doc_reader.py <doc_token>

文档 token 从 URL 提取:https://xxx.feishu.cn/docx/<doc_token>

2. 分析并优化内容

优化原则:

  • 结构清晰:使用标准章节编号(1. 2. 3.)
  • 层次分明:一级标题、二级标题、正文层次清晰
  • 内容精炼:删除冗余,保留核心信息
  • 视觉美观:使用 emoji 标记、分隔线、表格对齐
3. 替换文档内容

通过 Playwright 浏览器自动化:

python3 scripts/feishu_doc_editor.py <doc_token> <content_file>

流程:

  1. 连接已登录的浏览器
  2. 打开文档进入编辑模式
  3. 循环 Ctrl+A + Backspace 清空内容
  4. 逐行输入新内容

飞书 API 配置

租户配置
租户App ID用途
hanxingREDACTED_FEISHU_HANXING_APP_ID汉兴企业(默认)
personalREDACTED_FEISHU_PERSONAL_APP_ID个人应用
API 权限

需要的权限范围:

  • docx:document:readonly - 读取文档
  • docx:document - 编辑文档(API 方式)

优化模板

项目文档模板
# [项目名称]

> [一句话描述]
> 📅 版本:vX.X | 更新日期:YYYY-MM-DD

---

## 📋 目录
1. 项目背景  2. 系统架构  3. 核心功能  ...

---

## 1. 项目背景

### 1.1 痛点分析
🔴 痛点1 - 描述 ⭐⭐⭐⭐⭐
🔴 痛点2 - 描述 ⭐⭐⭐⭐

### 1.2 解决方案
方案描述...

---

## 2. 核心功能

### 2.1 功能名称 ✅
**功能**:功能描述
**流程**:步骤1 ➜ 步骤2 ➜ 步骤3

---

## N. 项目价值

### N.1 投入成本
| 项目 | 成本 | 说明 |
|------|------|------|
| 项目1 | ¥0 | 说明 |

### N.2 产出价值
⏱️ 指标1:描述
💰 指标2:描述

---

💡 如有改进建议,欢迎提出!

格式规范

Emoji 使用
场景Emoji
目录/导航📋
日期/版本📅
痛点/问题🔴
已完成✅
进行中🔄
待办⏳
重要提示⚠️ 💡
数据采集📥
数据处理⚙️
数据展示📊
时间⏱️
成本💰
增长📈
分隔符
  • 章节分隔:---(三个短横线)
  • 流程箭头:➜
  • 星级评分:⭐⭐⭐⭐⭐
表格格式
| 列1 | 列2 | 列3 |
|:---:|------|:---:|
| 居中 | 左对齐 | 居中 |

注意事项

  1. 登录状态:浏览器编辑需要已登录飞书
  2. API 限制:飞书 API 不支持直接删除文档块
  3. 编辑模式:确保文档处于"编辑"模式而非"阅读"模式
  4. 保存确认:编辑后等待"已保存到云端"提示

相关文件

  • scripts/feishu_doc_reader.py - 读取文档内容
  • scripts/feishu_doc_editor.py - 编辑文档内容
  • references/optimization-examples.md - 优化案例参考

Comments

Markdown supported