DingTalk Channel Auto-Connect (Headed Browser)
This skill automates the creation of a DingTalk application and the binding of a QwenPaw channel using a headed browser.
Mandatory Rules
- Must launch in headed browser mode:
{"action": "start", "headed": true}
Must pause when a login gate is encountered:
- If the page displays a login screen (e.g., login prompt, QR code login, phone/password login), stop automated operations immediately.
- Clearly prompt the user to log in manually first, then wait for the user to reply with "logged in / continue".
- Do not proceed with subsequent steps until the user confirms.
Any application configuration change only takes effect after creating a new version and publishing:
- After configuring bot-related information, you must publish the bot.
- Whether creating a new application or modifying application information (name, description, icon, bot configuration, etc.), you must perform "create new version + publish" at the end.
- Do not claim the configuration is active if publishing has not been completed.
Pre-Execution Confirmation (Must Do First)
Before starting automated clicks, initiate a "configuration confirmation" with the user, clearly informing them of customizable fields, image specifications, and default values. Use the following structured confirmation:
Allow the user to customize the following fields:
- Application name
- Application description
- Bot icon image URL or local path
- Bot message preview image URL or local path
Clearly state the image specifications (prominently):
- Bot icon: JPG/PNG only,
240*240px or larger, 1:1 ratio, under 2MB, no rounded corners.
- Bot message preview image: format
png/jpeg/jpg, no more than 2MB.
Clearly state the default values (used automatically if the user does not specify):
- Application name:
QwenPaw
- Application description:
Your personal assistant
- Bot icon:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png
- Bot message preview image:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png
If the user provides no custom values, you must first explicitly reply:
- "All default settings will be used (QwenPaw / Your personal assistant / default images). Proceeding now."
Image Upload Strategy (Both link and path are supported)
- If the user provides a local path, use it directly for upload.
- If the user provides an image link, download it to a local temporary file first, then upload.
- The upload action sequence must be:
- First click the page upload entry (to trigger the chooser)
- Then call
file_upload with the local path array (paths_json)
- If the upload fails due to image specification mismatch (dimensions, ratio, size, format):
- Immediately pause automation
- Clearly ask the user to manually upload a compliant image
- After the user confirms "uploaded / continue", resume from the current step
Practical Upload Tips
- The
paths_json of file_upload must be a "JSON string array" -- note the escaping:
{
"action": "file_upload",
"paths_json": "[\"xxx.png\"]",
"frame_selector": "iframe[src*=\"/fe/app?isHideOuterFrame=true\"]"
}
If the page is within an iframe, prefer including frame_selector; otherwise the upload control may not be found or the chooser may not trigger.
You must click the upload entry before calling file_upload; calling it directly will result in:
No chooser. Click upload then file_upload.
Common structural features of the bot icon area that can be used for locating elements (examples; these may appear as Chinese UI labels in the DingTalk console):
text: "* 机器人图标" (Bot Icon)
button: "使用应用图标" (Use App Icon)
button: "avatar" (usually contains img "avatar" inside)
When the snapshot shows both "使用应用图标" ("Use App Icon") and "avatar", prefer clicking the avatar button to trigger the upload, then call file_upload.
Automation Flow
Step 1: Open the DingTalk Developer Console
- Launch the browser in headed mode (
headed: true)
- Navigate to
https://open-dev.dingtalk.com/
- Call
snapshot to check if login is required
If login is required, pause with the following message:
Login to the DingTalk Developer Console is required. I have paused automated operations. Please complete the login in the opened browser. Reply "continue" when done, and I will resume from the current page.
Step 2: Create an Internal Enterprise Application
After the user confirms login, continue:
- Navigate to the creation path:
- Application Development -> Internal Enterprise Applications -> DingTalk Applications -> Create Application
- Fill in the application information (prefer user-customized values, otherwise use defaults):
- Application name: default
QwenPaw
- Application description: default
Your personal assistant
- Save and create the application
If the page text or structure does not match expectations, re-run snapshot and relocate elements based on visible text semantics.
Step 3: Add Bot Capability and Publish
- Click Add Application Capability under Application Capabilities, find Bot and add it
- Toggle the switch button on the right side of Bot Configuration to enabled
- Fill in Bot Name, Bot Brief, and Bot Description
- Upload the Bot Icon (user-customized or default image):
- Click the image below the bot icon label
- Default image URL:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png
- If it is a link, download to local first, then upload
- If the image does not meet specifications, pause and ask the user to manually upload a compliant image before continuing
- Upload the Bot Message Preview Image (user-customized or default image):
- Click the image below the bot message preview image label
- Default image URL:
https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png
- If it is a link, download to local first, then upload
- If the image does not meet specifications, pause and ask the user to manually upload a compliant image before continuing
- Confirm that the message receiving mode is set to
Stream Mode (the Chinese UI may display Stream 模式)
- Select Publish; a further confirmation dialog will appear -- select publish. Note: you must publish the bot before proceeding to the next step
Step 4: Create Version and Publish
- Navigate to
Application Release -> Version Management & Release
- Create a new version (required after every configuration change)
- Fill in the version description; set the application visibility scope to all employees
- Follow the page prompts to complete publishing; a new dialog will appear -- select confirm publish
- Only after seeing the successful publication status may you proceed with subsequent steps or tell the user "the configuration is now active"
Step 5: Obtain Credentials
- Navigate to
Basic Information -> Credentials & Basic Info
- Inform the user that the
Client ID (AppKey) and Client Secret (AppSecret) are on this page. Do not make changes proactively; guide the user to bind them on their own
QwenPaw Binding Methods
After obtaining the credentials, guide the user to choose one of the following methods:
Console frontend configuration:
- In the QwenPaw console, go to
Control -> Channels -> DingTalk
- Enter the
Client ID and Client Secret
Configuration file method:
"dingtalk": {
"enabled": true,
"bot_prefix": "[BOT]",
"client_id": "Your Client ID",
"client_secret": "Your Client Secret"
}
Path: ~/.qwenpaw/config.json, under channels.dingtalk.
Credential Delivery Requirements (Mandatory)
- The agent is only responsible for guiding the user to the credentials page, obtaining and displaying the
Client ID and the actual Client Secret.
- The agent must not proactively modify the
console configuration or ~/.qwenpaw/config.json.
- You must instruct the user to fill in the credentials manually using one of the following two methods:
- Console frontend:
Control -> Channels -> DingTalk
- Configuration file: edit the
channels.dingtalk field in ~/.qwenpaw/config.json
Browser Tool Usage Pattern
Execute in the following order by default:
start with headed: true
open
snapshot
click / type / select_option / press_key as needed
- frequent
snapshot after page transitions
stop when done
Stability and Recovery Strategy
- Prefer using the
ref from the latest snapshot; only use selector when necessary.
- After each critical click or navigation, use a short wait (
wait_for) and immediately re-run snapshot.
- If the session expires or re-login is required mid-flow, pause again and wait for the user to log in before continuing from the current step.
- If automation is blocked by tenant permissions or admin approval, clearly describe the blocker and ask the user to manually complete that step before resuming.
1---
2name: dingtalk-channel-connect
3description: "Use a headed browser to automatically complete DingTalk channel integration for QwenPaw. Applicable when the user mentions DingTalk, developer console, Client ID, Client Secret, bot, Stream mode, binding or configuring a channel. Supports pausing when a login page is detected and resuming after the user logs in."
4metadata:
5 builtin_skill_version: "1.3"
6 qwenpaw:
7 emoji: "🤖"
8 requires: {}
9---
10
11# DingTalk Channel Auto-Connect (Headed Browser)
12
13This skill automates the creation of a DingTalk application and the binding of a QwenPaw channel using a headed browser.
14
15## Mandatory Rules
16
171. Must launch in headed browser mode:
18
19```json
20{"action": "start", "headed": true}
21```
22
232. Must pause when a login gate is encountered:
24 - If the page displays a login screen (e.g., login prompt, QR code login, phone/password login), stop automated operations immediately.
25 - Clearly prompt the user to log in manually first, then wait for the user to reply with "logged in / continue".
26 - Do not proceed with subsequent steps until the user confirms.
27
283. Any application configuration change only takes effect after creating a new version and publishing:
29 - After configuring bot-related information, **you must publish the bot**.
30 - Whether creating a new application or modifying application information (name, description, icon, bot configuration, etc.), you **must perform "create new version + publish"** at the end.
31 - Do not claim the configuration is active if publishing has not been completed.
32
33## Pre-Execution Confirmation (Must Do First)
34
35Before starting automated clicks, initiate a "configuration confirmation" with the user, clearly informing them of customizable fields, image specifications, and default values. Use the following structured confirmation:
36
371. Allow the user to customize the following fields:
38 - Application name
39 - Application description
40 - Bot icon image URL or local path
41 - Bot message preview image URL or local path
42
432. Clearly state the image specifications (prominently):
44 - Bot icon: JPG/PNG only, `240*240px` or larger, `1:1` ratio, under `2MB`, no rounded corners.
45 - Bot message preview image: format `png/jpeg/jpg`, no more than `2MB`.
46
473. Clearly state the default values (used automatically if the user does not specify):
48 - Application name: `QwenPaw`
49 - Application description: `Your personal assistant`
50 - Bot icon: `https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png`
51 - Bot message preview image: `https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png`
52
534. If the user provides no custom values, you must first explicitly reply:
54 - "All default settings will be used (QwenPaw / Your personal assistant / default images). Proceeding now."
55
56## Image Upload Strategy (Both link and path are supported)
57
581. If the user provides a local path, use it directly for upload.
592. If the user provides an image link, download it to a local temporary file first, then upload.
603. The upload action sequence must be:
61 - First click the page upload entry (to trigger the chooser)
62 - Then call `file_upload` with the local path array (`paths_json`)
634. If the upload fails due to image specification mismatch (dimensions, ratio, size, format):
64 - Immediately pause automation
65 - Clearly ask the user to manually upload a compliant image
66 - After the user confirms "uploaded / continue", resume from the current step
67
68### Practical Upload Tips
69
701. The `paths_json` of `file_upload` must be a "JSON string array" -- note the escaping:
71
72```json
73{
74 "action": "file_upload",
75 "paths_json": "[\"xxx.png\"]",
76 "frame_selector": "iframe[src*=\"/fe/app?isHideOuterFrame=true\"]"
77}
78```
79
802. If the page is within an iframe, prefer including `frame_selector`; otherwise the upload control may not be found or the chooser may not trigger.
81
823. You must click the upload entry before calling `file_upload`; calling it directly will result in:
83 - `No chooser. Click upload then file_upload.`
84
854. Common structural features of the bot icon area that can be used for locating elements (examples; these may appear as Chinese UI labels in the DingTalk console):
86 - `text: "* 机器人图标"` (Bot Icon)
87 - `button: "使用应用图标"` (Use App Icon)
88 - `button: "avatar"` (usually contains `img "avatar"` inside)
89
905. When the snapshot shows both "使用应用图标" ("Use App Icon") and "avatar", prefer clicking the `avatar` button to trigger the upload, then call `file_upload`.
91
92## Automation Flow
93
94### Step 1: Open the DingTalk Developer Console
95
961. Launch the browser in headed mode (`headed: true`)
972. Navigate to `https://open-dev.dingtalk.com/`
983. Call `snapshot` to check if login is required
99
100If login is required, pause with the following message:
101
102> Login to the DingTalk Developer Console is required. I have paused automated operations. Please complete the login in the opened browser. Reply "continue" when done, and I will resume from the current page.
103
104### Step 2: Create an Internal Enterprise Application
105
106After the user confirms login, continue:
107
1081. Navigate to the creation path:
109 - Application Development -> Internal Enterprise Applications -> DingTalk Applications -> Create Application
1102. Fill in the application information (prefer user-customized values, otherwise use defaults):
111 - Application name: default `QwenPaw`
112 - Application description: default `Your personal assistant`
1133. Save and create the application
114
115If the page text or structure does not match expectations, re-run `snapshot` and relocate elements based on visible text semantics.
116
117### Step 3: Add Bot Capability and Publish
118
1191. Click **Add Application Capability** under **Application Capabilities**, find **Bot** and add it
1202. Toggle the switch button on the right side of **Bot Configuration** to enabled
1213. Fill in **Bot Name**, **Bot Brief**, and **Bot Description**
1224. Upload the **Bot Icon** (user-customized or default image):
123 - Click the image below the bot icon label
124 - Default image URL: `https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png`
125 - If it is a link, download to local first, then upload
126 - If the image does not meet specifications, pause and ask the user to manually upload a compliant image before continuing
1275. Upload the **Bot Message Preview Image** (user-customized or default image):
128 - Click the image below the bot message preview image label
129 - Default image URL: `https://img.alicdn.com/imgextra/i4/O1CN01M0iyHF1FVNzM9qjC0_!!6000000000492-2-tps-254-254.png`
130 - If it is a link, download to local first, then upload
131 - If the image does not meet specifications, pause and ask the user to manually upload a compliant image before continuing
1326. Confirm that the message receiving mode is set to `Stream Mode` (the Chinese UI may display `Stream 模式`)
1337. Select **Publish**; a further confirmation dialog will appear -- select publish. Note: **you must publish the bot** before proceeding to the next step
134
135### Step 4: Create Version and Publish
136
1371. Navigate to `Application Release -> Version Management & Release`
1382. Create a new version (required after every configuration change)
1393. Fill in the version description; set the application visibility scope to all employees
1404. Follow the page prompts to complete publishing; a new dialog will appear -- select confirm publish
1415. Only after seeing the successful publication status may you proceed with subsequent steps or tell the user "the configuration is now active"
142
143### Step 5: Obtain Credentials
144
1451. Navigate to `Basic Information -> Credentials & Basic Info`
1462. Inform the user that the `Client ID` (AppKey) and `Client Secret` (AppSecret) are on this page. Do not make changes proactively; guide the user to bind them on their own
147
148## QwenPaw Binding Methods
149
150After obtaining the credentials, guide the user to choose one of the following methods:
151
1521. Console frontend configuration:
153 - In the QwenPaw console, go to `Control -> Channels -> DingTalk`
154 - Enter the `Client ID` and `Client Secret`
155
1562. Configuration file method:
157
158```json
159"dingtalk": {
160 "enabled": true,
161 "bot_prefix": "[BOT]",
162 "client_id": "Your Client ID",
163 "client_secret": "Your Client Secret"
164}
165```
166
167Path: `~/.qwenpaw/config.json`, under `channels.dingtalk`.
168
169### Credential Delivery Requirements (Mandatory)
170
1711. The agent is only responsible for guiding the user to the credentials page, obtaining and displaying the `Client ID` and the actual `Client Secret`.
1722. The agent must not proactively modify the `console` configuration or `~/.qwenpaw/config.json`.
1733. You must instruct the user to fill in the credentials manually using one of the following two methods:
174 - Console frontend: `Control -> Channels -> DingTalk`
175 - Configuration file: edit the `channels.dingtalk` field in `~/.qwenpaw/config.json`
176
177## Browser Tool Usage Pattern
178
179Execute in the following order by default:
180
1811. `start` with `headed: true`
1822. `open`
1833. `snapshot`
1844. `click` / `type` / `select_option` / `press_key` as needed
1855. frequent `snapshot` after page transitions
1866. `stop` when done
187
188## Stability and Recovery Strategy
189
190- Prefer using the `ref` from the latest `snapshot`; only use `selector` when necessary.
191- After each critical click or navigation, use a short wait (`wait_for`) and immediately re-run `snapshot`.
192- If the session expires or re-login is required mid-flow, pause again and wait for the user to log in before continuing from the current step.
193- If automation is blocked by tenant permissions or admin approval, clearly describe the blocker and ask the user to manually complete that step before resuming.