feishu-doc
Skill0 starsChanged 7 months agoApache-2.0View on GitHub
Create and publish online documents in Feishu (Lark) cloud workspace from markdown or text content. Use this skill when the user wants to "create a Feishu doc", "make an online document in Feishu", "upload to Feishu docs", "published in Feishu", "create a Lark document", "make a Feishu page", or any request to turn content into a Feishu/Lark online document. Also use when converting markdown files to Feishu docx format, or when the user mentions words like "飞书文档", "飞书在线文档", "云文档", "创建文档". Covers uploading content via API, converting files to online documents via browser automation, and handling the Feishu docx conversion workflow. Do NOT use for editing existing documents, managing Feishu permissions, or general Feishu administration tasks unrelated to document creation.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- zrtch/awesome-skillstheir own version, first seen Nov 29, 2026
- CatCatUncle/openworkbuddytheir own version, first seen Nov 23, 2026
- kudeerliu48-web/CloseCodetheir own version, first seen Nov 1, 2026
- weininghui/skillstheir own version, first seen Oct 30, 2026
- m1heng/clawdbot-feishutheir own version, first seen Oct 8, 2026
- wulaosiji/skillstheir own version, first seen Sep 9, 2026
Used with
Projects with it also use deep-research and skill-creator.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
NVIDIASkilldeep-research
Queue deep, multi-step research and analysis tasks to the DeepAgents worker. Supports execution depth presets, request-specific rubrics, SubAgent delegation, and RubricMiddleware cross-validation.
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 4 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- m1heng/clawdbot-feishu★ 4.2ksame name
- CatCatUncle/openworkbuddy★ 448same name
- zrt-ai-lab/opencode-skills★ 277same name
- wulaosiji/skills★ 28same name
- kudeerliu48-web/CloseCode★ 14same name
- yangwhale/CloseCrab★ 5same name
- zrtch/awesome-skills★ 2same name
- weininghui/skills★ 1same name
- zty1205/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- docx-mcpSkill
- open-slideSkill
- pptxSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
Before starting, gather these from the user if not already known:
- Very specific: line 67
Write content as markdown.
- Very specific: line 85
Use the drive/v1/files/upload_all endpoint with parent_type=explorer.
- Distinctive: line 139
Wait for the page to redirect away from the login URL (poll every 2 seconds).
- Very specific: line 163
But note: If using the browser_tabs tool pattern, use action: "select" and index: 1 to switch to the new tab.
- Distinctive: line 177
If no content needs to be pre-filled, create a blank online document directly in the browser:
- Distinctive: line 182
Use JavaScript to click the menu item because Playwright locators may be blocked by overlays:
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Feishu Document Creator
Overview
Creates Feishu (Lark) online documents from markdown or text content. Uses a two-phase strategy: upload content via API, then convert to editable online document via Playwright browser automation. This hybrid approach works because Feishu's drive:drive API scope handles file uploads, while the "convert to online doc" step requires browser interaction (the docx:document API scope is separate and often unavailable).
Quick Reference
| Task | Method |
Upload .md file to Feishu Drive | drive/v1/files/upload_all API |
| Convert file to online docx | Playwright → click "转为在线文档" |
| Create empty document | Playwright → "新建" → "文档" |
| Get tenant access token | auth/v3/tenant_access_token/internal API |
Prerequisites
Before starting, gather these from the user if not already known:
| Item | Where to find |
| App ID | Feishu Open Platform → app credentials |
| App Secret | Feishu Open Platform → app credentials |
| Feishu tenant URL | Usually {subdomain}.feishu.cn |
| Root folder token | drive/explorer/v2/root_folder/meta API |
The app must have at minimum the drive:drive permission scope configured and published in the Feishu Open Platform.
Phase 1: Upload Content to Feishu Drive
Step 1.1: Get Tenant Access Token
import requests
resp = requests.post(
'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal',
json={'app_id': 'YOUR_APP_ID', 'app_secret': 'YOUR_APP_SECRET'}
)
token = resp.json()['tenant_access_token']The token is valid for ~2 hours. If permissions change, get a new token — the old one caches the previous permission set.
Step 1.2: Prepare Content
Write content as markdown. Use proper headings (#, ##), lists (-, 1.), tables, and code blocks. Feishu renders these faithfully.
Save content to a temporary .md file:
content = """# Document Title
## Section One
Your content here...
"""
temp_path = '/tmp/feishu_doc.md'
with open(temp_path, 'w', encoding='utf-8') as f:
f.write(content)Step 1.3: Upload via API
Use the drive/v1/files/upload_all endpoint with parent_type=explorer. Leave parent_node empty to upload to the tenant root.
file_size = len(content.encode('utf-8'))
resp = requests.post(
'https://open.feishu.cn/open-apis/drive/v1/files/upload_all',
headers={'Authorization': f'Bearer {token}'},
files={'file': ('document.md', content.encode('utf-8'), 'text/markdown')},
data={
'file_name': 'document.md',
'parent_type': 'explorer',
'parent_node': '',
'size': str(file_size),
}
)
result = resp.json()
if result['code'] == 0:
file_token = result['data']['file_token']
file_url = f'https://{tenant_domain}/file/{file_token}'Important: Files uploaded via tenant_access_token are owned by the app, not the user. They appear in the tenant's shared space but not in the user's personal "My Drive." This is expected — the browser phase handles the conversion to a user-owned document.
Common Upload Errors
| Error Code | Meaning | Fix |
99991672 | Missing API scope | Grant drive:drive in Feishu Open Platform, publish version |
99991663 | Token expired/invalidated | Get a fresh token (permissions changed) |
1061002 | Parameter error | Check parent_type is explorer, size matches |
Phase 2: Convert to Online Document (Playwright)
Step 2.1: Open Browser to File
Navigate the Playwright browser directly to the uploaded file URL:
// The file URL pattern is: https://{tenant}.feishu.cn/file/{file_token}
await page.goto(file_url);Step 2.2: Handle Login
Feishu requires authentication. The login page shows a QR code. Take a screenshot and ask the user to scan it with their Feishu mobile app:
await page.screenshot({ path: 'login_qr.png' });
// Show this to the user — they scan to log inWait for the page to redirect away from the login URL (poll every 2 seconds). Once the URL changes to the file page, login is complete.
Step 2.3: Convert to Online Document
On the file view page, there is a button labeled "转为在线文档" (Convert to Online Document). Click it:
await page.getByText('转为在线文档').click();This creates a new docx document in a new browser tab. The original .md file remains as-is.
Step 2.4: Capture the Document URL
Switch to the newly opened tab and extract the URL:
const tabs = await context.pages();
// The new tab is the last one
const docTab = tabs[tabs.length - 1];
const docUrl = docTab.url();
// Pattern: https://{tenant}.feishu.cn/docx/{doc_token}But note: If using the browser_tabs tool pattern, use action: "select" and index: 1 to switch to the new tab.
Step 2.5: Verify
Take a screenshot of the document to confirm the content rendered correctly:
await page.screenshot({ path: 'feishu_doc_result.png' });Alternative Path: Create Empty Document via Playwright
If no content needs to be pre-filled, create a blank online document directly in the browser:
- Navigate to
https://{tenant}.feishu.cn/drive/home/ - Handle QR code login (same as above)
- Click "新建" (New) → find "文档" (Document) in the dropdown menu
- Use JavaScript to click the menu item because Playwright locators may be blocked by overlays:
await page.evaluate(() => {
const spans = document.querySelectorAll('span');
for (const span of spans) {
if (span.textContent === '文档') {
let parent = span.parentElement;
while (parent && parent.tagName !== 'BODY') {
if (parent.classList.contains('menu-item')) {
parent.click();
return;
}
parent = parent.parentElement;
}
}
}
});- A new blank document tab opens — capture the URL as above.
Complete Example
User request: "帮我把这个总结发布到飞书上"
# Phase 1: Upload
import requests
token = get_tenant_token(app_id, app_secret)
content = generate_markdown_content() # your content here
resp = requests.post(
'https://open.feishu.cn/open-apis/drive/v1/files/upload_all',
headers={'Authorization': f'Bearer {token}'},
files={'file': ('summary.md', content.encode(), 'text/markdown')},
data={
'file_name': 'summary.md',
'parent_type': 'explorer',
'parent_node': '',
'size': str(len(content.encode())),
}
)
file_token = resp.json()['data']['file_token']
file_url = f'https://{tenant}.feishu.cn/file/{file_token}'
# Phase 2: Convert via Playwright
# (Use playwright skill to navigate to file_url, click "转为在线文档")
# Result: https://{tenant}.feishu.cn/docx/{new_doc_token}Error Recovery
| Problem | Recovery Strategy |
| QR code not scanned | Re-take screenshot, tell user explicitly "请用飞书手机端扫描二维码" |
| "转为在线文档" button not found | Wait longer for page to load, or refresh. If still missing, the file type may not be convertible — try parent_type variants |
| Dropdown menu blocks click | Press Escape to dismiss menu, then retry |
| File not visible in Drive | Navigate directly to file/{file_token} URL instead of browsing |
| API upload fails with 1061002 | Remove parent_node parameter or use empty string — root folder token may be rejected |
| Token returns old permissions | Get a new token; Feishu caches permissions in existing tokens |
Key Constraints
- API vs Browser: API can upload files but cannot convert them to online documents without
docx:documentscope. Browser automation is the reliable conversion path. - File Ownership: API-uploaded files are owned by the app. After browser conversion to docx, the new document is owned by the logged-in user.
- QR Code Login: Required for browser automation. There is no way to bypass this — Feishu web requires interactive authentication.
- Rate Limits: The
drive/v1/files/upload_allAPI has rate limits. For bulk operations, space out calls. - File Size: Maximum 20MB per file upload.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

