ai-dvps/comate/wecom-doc
Claude Code and agent skill by ai-dvps/comate
- community
Checking that the SKILL.md file is still in the repository.
Manage WeCom documents, smartpages, uploads, and smartsheets via the wecom CLI. Use when the user wants to read, create, edit, export, upload to, or manage WeCom docs, sheets, or smartpages, or when a doc.weixin.qq.com URL is mentioned.
Install
npx vskill@latest install ai-dvps/comate/wecom-docSKILL.md
<objective> Manage WeCom documents, smartpages (formerly "智能主页" / "智能文档"), uploads, and smartsheets through the wecom doc:* subcommands. Help the agent route URLs to the correct tool family, build oclif flag commands, and poll async export/read tasks to completion. </objective>
<quick_start> Read a document or sheet:
Create a document:
Upload an image to a document:
Get smartsheet metadata:
Add a record to a smartsheet:
Export every smartsheet in a document to one .xlsx file:
If wecom is not in PATH, use npx wecom or ${WECOM_CLI_PATH}. </quick_start>
<workflow>
- Verify CLI version: Before any operation, check the installed CLI version:
``bash wecom --version ` Expected: 1.2.0 or higher. If lower, advise the user to update: `bash npm install -g @webank/wecom@latest ` If wecom is not found, check npx wecom --version or ${WECOM_CLI_PATH} --version. If the CLI is not installed at all, advise installation: `bash npm install -g @webank/wecom ``
- Identify the URL category before reading or modifying anything:
/doc/*or/sheet/*→ usewecom doc:get-doc-content/smartpage/*→ usewecom doc:smartpage-export-task+wecom doc:smartpage-get-export-result/smartsheet/*→ use the smartsheet tools (wecom doc:smartsheet-*)
- Decide the tool family:
- Smartpages: Only when the user explicitly uses the terms 「智能文档」 (smart document) or 「智能主页」 (smart homepage).
- Smartsheets: When the URL is
/smartsheet/*or the user asks about smart tables/records/fields. - Uploads: When the user wants to attach an image or file to a document or smartsheet record.
- Standard docs: All other "document" scenarios use
doc:get-doc-content,doc:create-doc, ordoc:edit-doc-content.
- Build the command:
- Prefer typed flags (
--docid,--url,--type, etc.). - When passing complex JSON or fields not covered by flags, use
--json '{"key":"value"}'to override. - The smartsheet auto-file helpers (
smartsheet-add-records-auto-fileandsmartsheet-update-records-auto-file) use--datainstead of--jsonbecause oclif reserves--jsonas a built-in boolean flag.
- Create smartpages: When explicitly requested, use
doc:smartpage-createwith a local Markdown file path or--jsonfor multi-page input. Save the returned docid. - Handle uploads: For images/files attached directly to a doc, use
doc:upload-doc-imageordoc:upload-doc-file. For records that include image/file fields, prefer the auto-file helpers (doc:smartsheet-add-records-auto-file,doc:smartsheet-update-records-auto-file). - Export smartsheets to Excel: To save a whole smartsheet document as a workbook, use
doc:smartsheet-export-excel --docid DOCID --output PATH.xlsx. It exports every sheet (tab) into one.xlsxfile. This command writes a binary file locally — it does not take--jsonand prints the output path, not JSON. Pass--forceto overwrite an existing file. - Handle async polling:
get-doc-content,smartpage-export-task, andsmartpage-get-export-resultare async:
- First call returns a
task_id. - If
task_doneisfalse, call again with thetask_iduntiltask_doneistrue.
- Execute and report: Show the command and the outcome. If
errcodeis non-zero, surfaceerrcodeanderrmsgto the user and retry once.
</workflow>
<examples> <example number="1"> <input>Read the content of document DOC123</input> <output>
</output> </example>
<example number="2"> <input>Create a document called "Weekly Report"</input> <output>
Save the returned docid. </output> </example>
<example number="3"> <input>Set DOC123 content to "# Weekly Report\n\nAll done"</input> <output>
</output> </example>
<example number="4"> <input>Create a smartpage from docs/overview.md</input> <output>
Save the returned docid. </output> </example>
<example number="5"> <input>Export the smartpage at https://doc.weixin.qq.com/smartpage/xxx as Markdown</input> <output> Start the export task:
Poll for the result:
Repeat until task_done is true. </output> </example>
<example number="6"> <input>Upload an image to document DOC123</input> <output>
Save the returned url or media_id for use in document content. </output> </example>
<example number="7"> <input>Add a record to smartsheet DOC123 / sheet SHEET1</input> <output>
</output> </example>
<example number="8"> <input>Add a smartsheet record with an image file</input> <output>
The server resolves image_path/file_path fields to WeCom media IDs. </output> </example>
<example number="9"> <input>Export the smartsheet at https://doc.weixin.qq.com/smartsheet/DOC123 to Excel</input> <output>
Every sheet in the document is written as a worksheet in the .xlsx. The command prints the absolute output path. Add --force to overwrite an existing file. </output> </example> </examples>
<anti_patterns> <pitfall name="mixing_url_categories"> Different URL categories map to different tools. Never mix them:
/doc/*,/sheet/*→doc:get-doc-content/smartpage/*→doc:smartpage-export-task+doc:smartpage-get-export-result/smartsheet/*→doc:smartsheet-*tools
</pitfall>
<pitfall name="smartpage_mis trigger"> Only use smartpage_* tools when the user explicitly says 「智能文档」 or 「智能主页」. For all other "document" requests, use the standard WeCom doc tools. </pitfall>
<pitfall name="ignoring_async_polling"> get-doc-content and smartpage-export-task return a task_id on the first call. You must poll with that task_id until task_done is true before the content is available. </pitfall>
<pitfall name="plus_prefix"> The legacy Rust CLI required +smartpage_create. The new TypeScript CLI uses wecom doc:smartpage-create without any + prefix. </pitfall>
<pitfall name="json_vs_data"> Most commands accept --json to override the request body. The smartsheet auto-file helpers (smartsheet-add-records-auto-file and smartsheet-update-records-auto-file) use --data instead because oclif reserves --json as a built-in boolean flag. Passing --json to those commands will fail. </pitfall>
<pitfall name="export_excel_writes_a_file"> smartsheet-export-excel is the only smartsheet command that writes a binary file instead of printing JSON. It requires --output (a .xlsx path) and does not accept --json. If the file exists, it prompts in a TTY or exits 1 non-interactively unless --force is passed. Report the printed output path, not a JSON body. </pitfall>
<pitfall name="quoting_json_flags"> Flags like --fields, --records, --data expect JSON strings. Always wrap the JSON in single quotes on the shell to avoid expansion issues:
</pitfall>
<pitfall name="ignoring_exit_code"> The wecom CLI returns specific exit codes:
0: Success1: Invalid arguments or context file error2: No WeCom bot context found3: HTTP request failed4: Network error
Report the actual exit code and meaning to the user. </pitfall> </anti_patterns>
<success_criteria>
- URL category is correctly routed to the appropriate
doc:*tool - Smartpage tools are only used when explicitly triggered
- Smartsheet tools are used for
/smartsheet/*URLs and smart-table operations - Uploads are handled via
doc:upload-doc-image,doc:upload-doc-file, or auto-file helpers as appropriate - Smartsheet-to-Excel exports use
doc:smartsheet-export-excelwith--output(and--forcewhen overwriting), reporting the written file path - Async tasks are polled until
task_doneis true - Complex parameters are passed correctly via
--json(or--datafor auto-file helpers) - The executed CLI command is shown in the response
- Error codes and messages are reported clearly
</success_criteria>
Command taxonomy
| Family | Commands | |
|---|---|---|
| Document content | doc:get-doc-content, doc:create-doc, doc:edit-doc-content | |
| Smartpages | doc:smartpage-create, doc:smartpage-export-task, doc:smartpage-get-export-result | |
| Uploads | doc:upload-doc-image, doc:upload-doc-file | |
| Smartsheet structure | doc:smartsheet-get-sheet, doc:smartsheet-add-sheet, doc:smartsheet-update-sheet, doc:smartsheet-delete-sheet | |
| Smartsheet fields | doc:smartsheet-get-fields, doc:smartsheet-add-fields, doc:smartsheet-update-fields, doc:smartsheet-delete-fields | |
| Smartsheet records | doc:smartsheet-get-records, doc:smartsheet-add-records, doc:smartsheet-update-records, doc:smartsheet-delete-records | |
| Smartsheet export | doc:smartsheet-export-excel | |
| Smartsheet auto-file helpers | doc:smartsheet-add-records-auto-file, doc:smartsheet-update-records-auto-file |
Reference docs
- get-doc-content.md
- create-doc.md
- edit-doc-content.md
- smartpage-create.md
- smartpage-export.md
- upload-doc-image.md
- upload-doc-file.md
- smartsheet-get-sheet.md
- smartsheet-add-sheet.md
- smartsheet-update-sheet.md
- smartsheet-delete-sheet.md
- smartsheet-get-fields.md
- smartsheet-add-fields.md
- smartsheet-update-fields.md
- smartsheet-delete-fields.md
- smartsheet-get-records.md
- smartsheet-add-records.md
- smartsheet-update-records.md
- smartsheet-delete-records.md
- smartsheet-add-records-auto-file.md
- smartsheet-update-records-auto-file.md
- smartsheet-export-excel.md
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/wecom/.claude/skills/wecom-doc/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ai-dvps/comate/wecom-doc)