Use when the user wants to add a record into a DingTalk table through an automation webhook, especially when they describe the record in natural language, provide a Markdown file path as the content source, or need field validation, a field-summary preview, and explicit confirmation before sending. Image recognition is opt-in — only enabled when the user explicitly requests it.
Turn natural-language record requests into a configured DingTalk table automation webhook payload.
Core principle: read project config → fill fields → validate → preview → confirm → send.
When a Markdown file path is provided, 原始内容 comes from that file (content passed through as-is); controlled default filling applies to other business fields.
Do not use when the task is only to explain DingTalk APIs, for bulk import, or when there is no project config.
skills/dingtalk-table-webhook/dingtalk-table-webhooks.json. Do NOT read from skills-config/.Webhook URL: use webhook.env env var if set; otherwise webhook.url; otherwise stop and ask.
Do not echo full webhook URLs to the user.
If a defaults node is present, validate before proceeding:
| Default key | Constraint |
|---|---|
sharer | Must be stringArray; fields.sharer must exist and be type stringArray |
category | Must be in fields.category.options; fields.category must be type enum |
trigger | Must be a string; fields.trigger must exist and be type string |
creator | Must be a string; fields.creator must exist and be type string |
Any violation → config error, block execution. Never silently ignore.
Match user request against triggers in config (exact phrase match only, no fuzzy matching).
Extract only fields defined in the selected table's config. Do not invent values, auto-correct enums, or infer member IDs.
Recognize markdownFile only from explicit labels: Markdown 文件:, Markdown 文件路径:, md路径:.
Do not extract from code blocks, example text, links, or generic file mentions.
If the label is present but value is empty → stop and ask. If multiple paths resolve to different files → ask user to choose.
Read the Markdown file first so title/content values are available. Explicit user input always wins.
| Field | Fallback order |
|---|---|
| title | User input → first # heading → first non-empty text fragment → filename (without .md) |
| date | User input → today YYYY-MM-DD |
| sharer | User input → defaults.sharer → leave empty (optional) |
| creator | User input → defaults.creator → leave empty (optional) |
| category | User input → defaults.category → 技术动态 (only if in options) |
| trigger | User input → defaults.trigger → 前端分享 (only if fields.trigger exists) |
The 技术动态 and 前端分享 last-resorts are narrowly scoped share-record defaults, not generic fallbacks.
Final category must pass exact enum validation regardless of source.
If no trigger field in config, do not inject a trigger value.
When markdownFile is present, ignore any chat-provided content. 原始内容 must come only from the file.
识别图片, 需要识别图片, 处理图片).Block if: file is unreadable, missing, not .md, or produces blank output.
Exception: file contains only images and all fail → keep failure notes, do not block.
When image recognition is enabled:
节点 -> 节点 relations.Supported sources: local paths (relative to MD file or absolute), inline , reference-style.
Unsupported (failure note): http://https:// URLs, data: URIs, HTML <img> tags.
YYYY-MM-DD; if ambiguous → ask, do not guessAsk for all missing fields in one message.
Use config keys (recordsKey, fieldsKey). Build as structured data and serialize with json.dump. Do not hand-build JSON strings.
Show:
原始内容来源: Markdown 文件 <path> (if applicable)Ask for explicit confirmation. Never send on implied intent.
After confirmation, pipe payload via stdin to the send script — no temp file needed:
import json, subprocess, sys
payload = { ... }
proc = subprocess.run(
[sys.executable, "skills/dingtalk-table-webhook/scripts/send_webhook.py", "-", "<table_key>"],
input=json.dumps(payload, ensure_ascii=False),
capture_output=True, text=True
)
print(proc.stdout)
if proc.returncode != 0:
print(proc.stderr)
Do NOT use the Write tool to produce a JSON file — it does not escape special characters correctly.
Report: table name, HTTP status, response summary. On failure, note likely cause (missing config, invalid enum, malformed payload, webhook rejection).
Before confirmation:
目标表:<label>
准备写入的记录:
- <field>: <value>
- 原始内容来源: Markdown 文件 <path>(如适用)
请确认是否发送。
After sending:
已发送到:<label>
- HTTP 状态:<status>
- 结果:<short summary>
skills/dingtalk-table-webhook/dingtalk-table-webhooks.json (not skills-config/)defaults validated (types, enum membership)send_webhook.py (no temp file, no Write tool for JSON)