lark-doc
This runbook enables an AI agent to interact with Feishu (Lark) cloud documents using the `lark-cli` command-line tool and the Lark Docs v2 API. The agent can create new documents, fetch document content in multiple detail levels and scopes, update documents using eight distinct
6 steps · start to finish.
- 1Step 1
Environment Setup
▶Before executing any document operation, you MUST read the shared Lark skill documentation:
# Verify lark-cli is installed lark-cli --version # Read shared authentication and global parameters guide # This is MANDATORY — do not skip cat "$(lark-cli skill-path lark-shared)/SKILL.md" 2>/dev/null || echo "Read lark-shared/SKILL.md from the skills repository" # Create output directories mkdir -p /app/resultsCRITICAL prerequisite reading before any operation:
lark-shared/SKILL.md— authentication, permissions, global parameters (required for ALL operations)- For fetch →
lark-doc-fetch.md(scope/detail selection, partial read strategies,<fragment>/<excerpt>output structure) - For create or edit →
lark-doc-xml.md(XML syntax rules); uselark-doc-md.mdonly when user explicitly requests Markdown - For creating from scratch → also read
lark-doc-create-workflow.md - For editing existing documents → also read
lark-doc-update-workflow.md
Skipping these reference files causes parameter errors, format errors, or style failures.
- 2Step 2
Determine Operation
▶Identify which operation the user wants based on their request:
- 3Step 3
Execute the Operation
▶lark-cli docs +fetch --api-version v2 --doc "DOCUMENT_URL_OR_TOKEN"
- 4Step 4
Handle Embedded Resources
▶When document content contains embedded resource tags, extract tokens and switch to the appropriate skill:
- 5Step 5
Iterate on Errors (max 3 rounds)
▶If an operation fails:
- 6Step 6
Write Results
▶RESULTS_DIR="/app/results"