agentleFS
KilimiaoSixKilimiaoSix/agent-skills/skills/feishu-block-surgery/SKILL.md

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.

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
  1. Distinctive:

    Use this skill when the user gives a Feishu Docx URL/token and wants targeted edits to an existing document.

    line 10
  2. Very specific:

    Do not use it for Sheets/Base/Slides work, brand-new documents with no existing structure, or summarize-only requests.

    line 12
  3. Very specific:

    Use block_replace for targeted table/section edits.

    line 37
  4. Very specific:

    Use block_insert_after, block_move_after, and block_delete for local layout adjustment.

    line 38
  5. Very specific:

    Use full overwrite --doc-format xml only when the user explicitly wants a structural rewrite or the doc is too rough to patch safely.

    line 39
  6. Distinctive:

    Keep the original table/section skeleton unless the user asks for a redesign.

    line 64
  7. Distinctive:

    Prefer concrete, project-specific Chinese wording over generic abstractions.

    line 65
  8. Distinctive:

    When the user says "先不用改源文件", stage or show the draft before remote writes.

    line 66
  9. Very specific:

    If private platform/bot access fails but user-level lark-cli works, use user auth instead of forcing the private bot path.

    line 67

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Confirm the doc URL/token, target sections, and whether the user wants preview-first behavior.
  2. Check auth:
lark-cli auth status --verify
  1. Fetch the current structure before editing:
lark-cli docs +fetch --api-version v2 --doc "$DOC" --scope outline --detail with-ids
  1. 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
  1. Pick the lightest edit form:
    • Use block_replace for targeted table/section edits.
    • Use block_insert_after, block_move_after, and block_delete for local layout adjustment.
    • Use full overwrite --doc-format xml only when the user explicitly wants a structural rewrite or the doc is too rough to patch safely.
  2. Apply edits incrementally:
lark-cli docs +update --api-version v2 --doc "$DOC" --command block_replace --block-id <block_id> --content @content.xml

For 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>
  1. 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
  1. 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-cli works, 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 +update flags: use documented lark-cli v2 flags only.
  • docs +media-insert rejects absolute paths: cd to 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.