WeChat DevTools Automation Skill: Driving Repeatable Mini Program Workflows via Terminal

Preface

Mini-program joint debugging often relies heavily on the WeChat Developer Tools: modify a page, click a few steps, check data, take a screenshot, and then repeat the cycle. Manually clicking the simulator is suitable for one-off troubleshooting. However, once you need to perform smoke checks, regress specific page paths, or have a coding Agent run through a flow using fixed steps, you need a set of conventions capable of launching/connecting to DevTools, operating pages, extracting data, mocking wx, and taking screenshots from the terminal.

Below is an introduction to the SkillHub community Skill: “WeChat Developer Tools Automation skill”. Designed for harness engineering scenarios, it organizes miniprogram-automator capabilities into Agent-followable SKILL instructions, facilitating the repeatable execution of the above workflows in environments like Cursor and Claude Code.

What is this

In one sentence: It guides AI Agents in automating the mini-program debugging workflow within WeChat Developer Tools from the terminal via miniprogram-automator.

  • Coordinates: @user_aa41fce0/wechat-miniprogram-automator
  • Version: 1.0.0 (as noted on the SkillHub page)
  • Source: community, published by user_aa41fce0
  • Category: dev-programming
  • Tags: requires_api_key=false (No API Key configuration is required to install or use this Skill)

Official Description: Use this when repeatable mini-program workflows are needed, such as launching or connecting to DevTools, reopening routes, clicking by selector, filling in inputs, collecting page data, mocking wx methods, or taking screenshots during debugging and smoke checks.

SkillHub Statistics (based on SkillHub API data): Rating 100000, Downloads 5893, Installs 191.

Core Features

The following capabilities are derived from the Skill’s official description, summarizing “what the Agent should do”:

  1. Launch and Connect DevTools: Launch the Developer Tools from the terminal or connect to an already running instance.
  2. Pages and Routing: Reopen specific page paths to facilitate fixed regression paths.
  3. UI Operations: Click and fill input boxes by selector, simulating user operations in the simulator.
  4. Data and Mock: Collect page data; mock wx related methods during debugging.
  5. Screenshots: Save interface screenshots during debugging or smoke checks.

The underlying dependency is miniprogram-automator (Mini Program Automation JS SDK) provided by WeChat. The value of this Skill lies in translating the above scenarios into instructions executable by an Agent, rather than replacing the official WeChat SDK documentation.

Installation and Activation

Install via SkillHub CLI

First, confirm that skillhub is installed on your local machine (refer to the SkillHub Installation Guide for installation methods). When installing the Skill, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to installing to ./skills/, which the Agent may fail to load.

command -v skillhub && skillhub --version
skillhub install user_aa41fce0/wechat-miniprogram-automator --dir <skills directory>

Skills directories for common Agents (excerpted from SkillHub installation docs):

  • Claude Code: ~/.claude/skills/
  • Cursor: ~/.cursor/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

After installation, restart or refresh the Skill loading according to your Agent’s conventions. The SkillHub page does not separately detail differences between Cursor and Claude Code; refer to the installation documentation for the paths above.

Let AI Install via Prompt

The installation prompt provided by the SkillHub page is as follows; you can send the original text to your Agent:

Please install `@user_aa41fce0/wechat-miniprogram-automator` according to https://skillhub.cn/install/skillhub.md.

Typical Usage

The SKILL.md inside the Skill package is not directly browsable on the SkillHub site; combined with the official description, typical usage can be summarized in the following steps:

  1. Install and enable @user_aa41fce0/wechat-miniprogram-automator in the Agent.
  2. State the goal in the conversation: e.g., “Connect to current DevTools”, “reLaunch from a path”, “Click a selector with a specific class”, “Fill out a form and read page data”, “Mock a specific wx API”, “Take a screenshot after running the flow”.
  3. The Agent follows the conventions in the Skill to write or adjust terminal scripts based on miniprogram-automator, executing launch/connection, page operations, and assertions.

When running miniprogram-automator, the WeChat Developer Tools must have CLI / HTTP calls enabled in the security settings; otherwise, the SDK cannot drive the tool automation properly. Specific requirements for Node version, base library, and Developer Tools version are subject to the WeChat Open Documentation “Quick Start”; this Skill page does not relist these environment items.

A minimal SDK example is as follows (Source: WeChat Open Documentation Quick Start, consistent with the miniprogram-automator in the Skill description, facilitating local environment verification before handing over to the Agent):

npm i miniprogram-automator --save-dev
const automator = require('miniprogram-automator')

automator.launch({
  cliPath: 'path/to/cli',
  projectPath: 'path/to/project',
}).then(async miniProgram => {
  const page = await miniProgram.reLaunch('/page/component/index')
  await page.waitFor(500)
  const element = await page.$('.kind-list-item-hd')
  console.log(await element.attribute('class'))
  await element.tap()
  await miniProgram.close()
})

For DevTools with the automation port already open, you can connect using methods like automator.connect({ wsEndpoint: 'ws://localhost:9420' }); for ports and CLI parameters, refer to the Automator Module Documentation.

Scenarios and Caveats

Who is it for

  • Mini-program developers who want to turn “Open Tools -> Enter Page -> Click/Fill -> Extract Data/Screenshot” into repeatable scripts or hand it over to an Agent for orchestration.
  • Professionals working on harness/engineering who need to run fixed mini-program paths in CI or local smoke tests (within the capabilities of DevTools and miniprogram-automator).

Limitations and Notes

  • This Skill is a community release, maintained by SkillHub user user_aa41fce0. It is a different product line from the WeChat official “Developer Tools Skills” (e.g., wechatide); do not mix installation methods and commands.
  • Automation relies on the local machine having WeChat Developer Tools installed, the project path being correct, and security settings allowing CLI/HTTP calls.
  • The Skill does not declare a need for an API Key; however, you must still comply with existing constraints regarding WeChat accounts, project AppIDs, and tool logins.
  • The SkillHub page does not provide an online preview of the detailed SKILL.md for this Skill; for complex workflows, the locally installed Skill content should prevail.

Conclusion

The “WeChat Developer Tools Automation skill” consolidates DevTools operations driven by miniprogram-automator into Agent-executable instructions, making it suitable for scenarios requiring repeatable mini-program debugging and smoke testing. Refer to SkillHub for installation and coordinates.

  • SkillHub Page: https://www.skillhub.cn/skills/user_aa41fce0/wechat-miniprogram-automator
  • API Entry: https://api.skillhub.cn/user_aa41fce0/wechat-miniprogram-automator
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye