SuperAPI AI Directory

feishu-docs

Agents & models

View repository

Updated 10-16 05:04

About this skill

Feishu Docs Skill

You are managing the Feishu document operations skill. User data is stored in ~/.feishu-docs/。

First, locate the skill directory by finding this SKILL.md file:

  • Use the Glob pattern **/skills/**/feishu-docs/SKILL.md to find its path, then derive the skill root directory from it.
  • Keep this path in mind as SKILL_DIR, to be used for all subsequent file references.

Command Parsing

From $ARGUMENTS , parse the user's intent and map it to one of the following subcommands:

User says (example) Subcommand
setup, configure, 配置 setup
create <title>, 创建文档 <title> create
list, 列出文档 list
read <docToken>, 读取文档 <docToken> read
update <docToken> <content>, 更新文档 <docToken> update
delete <docToken>, 删除文档 <docToken> delete

Extract optional parameters.

Runtime Detection

Before executing any subcommand, detect which environment you are running in:

  1. Interactive skill host — AskUserQuestion tool is available. Use it for the interactive setup wizard.
  2. Non-interactive host — AskUserQuestion is not available. Fall back to non-interactive guidance: explain the steps, show SKILL_DIR/config.env.example, and ask the user to manually create ~/.feishu-docs/config.env。

You can test this by checking whether AskUserQuestion is in the list of available tools.

Configuration Check (applicable to create、list、read、update、delete)

Before running any subcommand other than setup , check whether ~/.feishu-docs/config.env exists:

  • If it does not exist:
    • In an interactive host: tell the user "Configuration not found" and automatically use AskUserQuestion to launch the setup wizard.
    • In a non-interactive host: tell the user "Configuration not found. Please create ~/.feishu-docs/config.envaccording to the example:" then show SKILL_DIR/config.env.example and stop. Do not attempt to perform document operations.
  • If it exists: Continue executing the requested subcommand.

Subcommands

setup

Run the interactive setup wizard. This subcommand requires AskUserQuestion. If it is unavailable, show SKILL_DIR/config.env.example with a field-by-field explanation, and guide the user to manually create the configuration file.

When AskUserQuestion is available,field by fieldcollect input. After each answer, confirm the value with the user (show only the last 4 characters of secrets), then proceed to the next question.

Step 1 — Configuration

Collect the following information:

  1. App ID - obtained from the Feishu Open Platform
  2. App Secret - obtained from the Feishu Open Platform
  3. Domain(optional) - default https://open.feishu.cn, use https://open.larksuite.com
  4. Default folder Token(optional) - the default location for document creation

Before asking for credentials, first read SKILL_DIR/references/setup-guide.md and show the relevant platform guidance to the user.

Step 2 — Write the configuration and verify

  1. Show the final summary table with all settings clearly displayed (show only the last 4 characters of secrets)
  2. Ask the user for confirmation before writing
  3. Use Bash to create the directory structure:mkdir -p ~/.feishu-docs/{data,logs}
  4. Use Write to create ~/.feishu-docs/config.env, with all settings in KEY=VALUE format
  5. Use Bash to set permissions:chmod 600 ~/.feishu-docs/config.env
  6. Verify credentials:
    • Use Write to create a temporary JSON file used only for the current verification, for example ~/.feishu-docs/data/auth-check.json
    • file contents include app_id and app_secret
    • Use Bash to call:curl -s -X POST "${DOMAIN}/open-apis/auth/v3/tenant_access_token/internal" -H "Content-Type: application/json" --data-binary "@$HOME/.feishu-docs/data/auth-check.json"
    • Delete the temporary file immediately after verification
    • Only report to the user code / msg / success or failure, never echo the request body, App ID, or App Secret
  7. Report the result with a summary table. If any verification fails, explain what might have gone wrong and how to fix it.
  8. On success, tell the user: "Setup complete! You can now use the Feishu document commands."

create <title> [content]

Create a new Feishu document.

  1. Extract the title and optional content from the parameters
  2. If no content is provided, prompt the user for input or read from the clipboard/current file
  3. Use Write to create a temporary parameter file (JSON), for example ~/.feishu-docs/data/create-args.json
  4. Write { "command": "create", "title": "...", "content": "..." }
  5. Call node SKILL_DIR/scripts/feishu-docs.js --args-file "$HOME/.feishu-docs/data/create-args.json"
  6. Delete the temporary parameter file after running
  7. Show the result to the user, including the document link

list

List recent Feishu documents.

Run:node SKILL_DIR/scripts/feishu-docs.js list

Display the document list, including titles, last modified times, and document links.

read <docToken>

Read Feishu document content.

  1. Use Write to create a temporary parameter file (JSON), for example ~/.feishu-docs/data/read-args.json
  2. Write { "command": "read", "docToken": "..." }
  3. Run:node SKILL_DIR/scripts/feishu-docs.js --args-file "$HOME/.feishu-docs/data/read-args.json"
  4. Delete the temporary parameter file after running

Display the document content. If the content is long, it can be displayed in sections.

update <docToken> <content>

Update Feishu document content.

  1. Use Write to create a temporary parameter file (JSON), for example ~/.feishu-docs/data/update-args.json
  2. Write { "command": "update", "docToken": "...", "content": "..." }
  3. Run:node SKILL_DIR/scripts/feishu-docs.js --args-file "$HOME/.feishu-docs/data/update-args.json"
  4. Delete the temporary parameter file after running

delete <docToken>

Delete a Feishu document.

  1. Confirm before deleting
  2. Use Write to create a temporary parameter file (JSON), for example ~/.feishu-docs/data/delete-args.json
  3. Write { "command": "delete", "docToken": "..." }
  4. Run:node SKILL_DIR/scripts/feishu-docs.js --args-file "$HOME/.feishu-docs/data/delete-args.json"
  5. Delete the temporary parameter file after running
  6. Clearly explain to the user that this operation will move the document to the recycle bin

Notes

  • Always mask secrets in the output (show only the last 4 characters)
  • The configuration file permissions should be 600
  • Document operations require the corresponding Feishu API permissions
  • Do not inline secrets, tokens, or user content directly into shell commands; prefer passing parameters via temporary files
  • Error output should report only the necessary status information, and should not echo the raw request body or the complete exception object