Optimize the content structure, layout format, and visual aesthetics of Feishu Cloud Docs.
Workflow
1. Read document content
Use the Feishu API to read the original document content:
python3 scripts/feishu_doc_reader.py <doc_token>
Extract the document token from the URL:https://xxx.feishu.cn/docx/<doc_token>
2. Analyze and optimize content
Optimization principles:
- Clear structure: Use standard section numbering (1. 2. 3.)
- Distinct hierarchy: Clear hierarchy of level-1 headings, level-2 headings, and body text
- Concise content: Remove redundancy and keep core information
- Visually appealing: Use emoji markers, dividers, and table alignment
3. Replace document content
Via Playwright browser automation:
python3 scripts/feishu_doc_editor.py <doc_token> <content_file>
Process:
- Connect to the logged-in browser
- Open the document and enter edit mode
- Loop Ctrl+A + Backspace to clear content
- Type the new content line by line
Feishu API Configuration
Tenant Configuration
| Tenant | App ID | Purpose |
|---|---|---|
| hanxing | REDACTED_FEISHU_HANXING_APP_ID | Hanxing Enterprise (default) |
| personal | REDACTED_FEISHU_PERSONAL_APP_ID | Personal app |
API Permissions
Required permission scopes:
docx:document:readonly- Read documentsdocx:document- Edit documents (API method)
Optimization Templates
Project Document Template
# [项目名称]
> [一句话描述]
> 📅 版本: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:描述
---
💡 如有改进建议,欢迎提出!
Format Specifications
Emoji Usage
| Scenario | Emoji |
|---|---|
| Table of contents/navigation | 📋 |
| Date/version | 📅 |
| Pain points/problems | 🔴 |
| Completed | ✅ |
| In progress | 🔄 |
| To-do | ⏳ |
| Important notice | ⚠️ 💡 |
| Data collection | 📥 |
| Data processing | ⚙️ |
| Data presentation | 📊 |
| Time | ⏱️ |
| Cost | 💰 |
| Growth | 📈 |
Separators
- Section separator:
---(three hyphens) - Process arrow:
➜ - Star rating:
⭐⭐⭐⭐⭐
Table Format
| 列1 | 列2 | 列3 |
|:---:|------|:---:|
| 居中 | 左对齐 | 居中 |
Notes
- Login status: Browser editing requires being logged in to Feishu
- API limitations: The Feishu API does not support directly deleting document blocks
- Edit mode: Ensure the document is in "Edit" mode rather than "Read" mode
- Save confirmation: After editing, wait for the "Saved to cloud" prompt
Related Files
scripts/feishu_doc_reader.py- Read document contentscripts/feishu_doc_editor.py- Edit document contentreferences/optimization-examples.md- Optimization case reference