feishu-block-surgery
Skill1 starsChanged 5 months agoMITView on GitHub
Use for targeted Feishu Docx editing with lark-cli v2 when the user wants an existing remote Feishu document synced to local code/docs, a section or table preserved while wording is refined, or files embedded into specific table cells. Triggers include "飞书的文档帮忙也改一下", "按照原表格格式", "附件放到表格中", "先不用改源文件", and Feishu Docx URLs where structure must be preserved.
In this repository14 other files it gives its agents.
- api-doc-writerSkill
- autonomous-multi-agent-developmentSkill
- design-doc-to-ui-feishu-docSkill
- design-doc-to-ui-figma-replicaSkill
- design-doc-to-ui-negative-caseSkill
- design-doc-to-uiSkill
- design-doc-to-ui-visual-auditSkill
- enforce-engineering-disciplineSkill
- frontend-design-codexSkill
- goal-prompt-builderSkill
- photo-review-workflowSkill
- smart-searchSkill
- subagent-model-routerSkill
- svg-board-generatorSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when the user gives a Feishu Docx URL/token and wants targeted edits to an existing document.
- Very specific: line 12
Do not use it for Sheets/Base/Slides work, brand-new documents with no existing structure, or summarize-only requests.
- Very specific: line 37
Use block_replace for targeted table/section edits.
- Very specific: line 38
Use block_insert_after, block_move_after, and block_delete for local layout adjustment.
- Very specific: line 39
Use full overwrite --doc-format xml only when the user explicitly wants a structural rewrite or the doc is too rough to patch safely.
- Distinctive: line 64
Keep the original table/section skeleton unless the user asks for a redesign.
- Distinctive: line 65
Prefer concrete, project-specific Chinese wording over generic abstractions.
- Distinctive: line 66
When the user says "先不用改源文件", stage or show the draft before remote writes.
- Very specific: line 67
If private platform/bot access fails but user-level lark-cli works, use user auth instead of forcing the private bot path.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Feishu Block Surgery
Use this skill when the user gives a Feishu Docx URL/token and wants targeted edits to an existing document. Prefer preserving the current structure and changing only the requested blocks.
Do not use it for Sheets/Base/Slides work, brand-new documents with no existing structure, or summarize-only requests.
Workflow
- Confirm the doc URL/token, target sections, and whether the user wants preview-first behavior.
- Check auth:
lark-cli auth status --verify- Fetch the current structure before editing:
lark-cli docs +fetch --api-version v2 --doc "$DOC" --scope outline --detail with-ids- Narrow to the smallest useful scope:
lark-cli docs +fetch --api-version v2 --doc "$DOC" --scope section --start-block-id <block_id> --detail full
lark-cli docs +fetch --api-version v2 --doc "$DOC" --scope keyword --keyword "<text>" --detail with-ids- Pick the lightest edit form:
- Use
block_replacefor targeted table/section edits. - Use
block_insert_after,block_move_after, andblock_deletefor local layout adjustment. - Use full
overwrite --doc-format xmlonly when the user explicitly wants a structural rewrite or the doc is too rough to patch safely.
- Use
- Apply edits incrementally:
lark-cli docs +update --api-version v2 --doc "$DOC" --command block_replace --block-id <block_id> --content @content.xmlFor overwrite flows, fetch the current revision_id and pass it explicitly:
lark-cli docs +update --api-version v2 --doc "$DOC" --command overwrite --doc-format xml --content @file.xml --revision-id <revision_id>- For attachments, upload from the artifact directory and then move the resulting file block into place:
cd /path/to/artifacts
lark-cli docs +media-insert --api-version v2 --doc "$DOC" --file ./artifact.zip --type file- Re-fetch the touched section/table and verify remote state.
User Preferences Captured
- Keep the original table/section skeleton unless the user asks for a redesign.
- Prefer concrete, project-specific Chinese wording over generic abstractions.
- When the user says "先不用改源文件", stage or show the draft before remote writes.
- If private platform/bot access fails but user-level
lark-cliworks, use user auth instead of forcing the private bot path. - Attachment placement matters: files should end up in the requested table/section, not merely appended somewhere in the document.
Pitfalls
- Unknown
docs +updateflags: use documented lark-cli v2 flags only. docs +media-insertrejects absolute paths:cdto the artifact directory and pass a relative path.- Uploading attachments before planning placement often leaves them outside the target table; upload, note block IDs, then move.
- Full overwrite can damage structure; use it only when the user wants a full rewrite.
Output
Report the exact changed sections, attachment placement, and verification method. Include the new revision ID when an overwrite or revision-sensitive update was used.
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.

