WeChat Mini Program Toolkit: Covering Full-Link Development with Agent Skills

Introduction

WeChat Mini Programs and general Web frontends do not share the same constraints: package size is restricted by subpackage and 2MB rules; login and payment require WeChat Open Capabilities; and Cloud Development, Subscription Messages, and Content Security each have independent documentation. Relying on search engines to piece together fragments often leads to using deprecated APIs or repeated trial-and-error regarding subpackage and authentication details.

Below, we introduce the Wechat Miniprogram Toolkit on SkillHub. It integrates capabilities such as initialization, Cloud Development, payment, and subpackage analysis into a standard SKILL.md and references/ documentation. This allows Coding Agents to load the corresponding chapters based on the task, rather than searching official documentation from scratch every time.

What is this

Wechat Miniprogram Toolkit (package name wechat-miniprogram-toolkit, current public metadata version 1.6.0, MIT License) is an Agent Skill designed for WeChat Mini Programs. SkillHub classifies it under dev-programming, with a community rating of 93834 and a cumulative total of 1574 downloads (according to platform statistics in the task brief).

The release path is @user_64e5b706/wechat-miniprogram-toolkit. The Skill’s README integrates common Tencent Cloud practices, Skyline Worklet specifications, and CI/CD references, aiming to provide a one-stop guide from project initialization to release. Framework-level details remain subject to the WeChat Open Documentation.

Official Entry Points:

  • API Address: https://api.skillhub.cn/user_64e5b706/wechat-miniprogram-toolkit
  • Community Page: https://www.skillhub.cn/skills/user_64e5b706/wechat-miniprogram-toolkit

Core Functions

The Skill entry point SKILL.md and topic-specific references/*.md cover the following modules (organized according to official descriptions):

  1. Engineering & Standards: Project directory, project.config.json, app.json initialization (project-init.md).
  2. Cloud Development: Database, storage, cloud functions, including aggregate queries and transactions (cloud-dev.md).
  3. Login & Authentication: openid / UnionID, phone numbers, etc. (auth.md).
  4. WeChat Payment: JSAPI, unified order, payment notifications, refunds (payment.md).
  5. Live Streaming & Real-time Audio/Video: live components and TRTC related guidelines (live-stream.md).
  6. Data & Growth: Data analysis, tracking (analytics.md); sharing, posters, Moments (share.md).
  7. TypeScript: Type and generic encapsulation (typescript.md).
  8. Cloud Hosting: Containerized backend (cloudhosting.md).
  9. Messaging: Customer service messages, subscription messages (messaging.md).
  10. Compliance & Navigation: Content security audit (content-safety.md); APP and Mini Program mutual jumps, URL Scheme (miniapp-handoff.md).
  11. Device Capabilities: Bluetooth, GPS, NFC, Wi-Fi, QR scanning, etc. (hardware.md).
  12. Performance & Rendering: Subpackage strategy (subpackage.md); Skyline / Worklet (advanced-render.md); WXS and performance (wxs-performance.md).
  13. Engineering: CI/CD (ci-cd.md); Python script scripts/analyze_subpackages.py for subpackage analysis; references/error-log.md to record errors and evolution.

The Skill declares the applicable base library versions: ≥ 2.2.3 (Cloud Development), ≥ 3.0 (Skyline). It explicitly lists non-applicable scenarios including: Web-side WeChat login (requires other skills), non-WeChat Mini Programs, and server-side forms strongly dependent on non-Cloud Development merchant backend direct connections that are not covered.

Installation & Activation

First, install the package, then trigger the documentation within the Skill using natural language during conversation. Public data provides two installation methods; choose one based on your toolchain.

Method 1: SkillHub CLI (As written in the Skill Quick Start guide)

skillhub install wechat-miniprogram-toolkit

If the CLI is not installed, the Skill instructions allow the Agent to assist in preparing the SkillHub environment.

Method 2: secure-skills-cli (The same package listed on mirror pages like the 360 Security Skill Center)

npx secure-skills-cli add wechat-miniprogram-toolkit

After installation, the Agent should read the SKILL.md in the Skill root directory and load the corresponding references/ files according to the “Read Before Writing Code” table. Clients such as Cursor, Codex CLI, and Claude Code behave consistently if they support Skill directories or SkillHub integration: the local Skill package is the standard, and no additional configuration files are needed (do not fabricate specific paths if public materials do not provide differences for each client).

Typical Usage

Following the installation steps above, you can reproduce the official examples based on the following categories of tasks.

1. Initialize a project from scratch

Instruct the Agent on the requirements, for example: “Help me create a WeChat Mini Program project that includes Cloud Development, subpackages, and login functions.” The Agent should refer to references/project-init.md to generate the directory and configuration.

2. Pre-release Subpackage Analysis

After preparing pages and resources in the project root directory, ask the Agent to run the subpackage script. The command looks like this:

python scripts/analyze_subpackages.py <project-directory> --main-max 2 --pkg-max 2

The script will output a subpackage configuration snippet that can be merged into app.json.

3. Cloud Development CRUD (Snippet Example)

The database read/write patterns in the Skill documentation are as follows; the Agent can use this as a reference when generating business code:

const db = wx.cloud.database()
await db.collection('posts').add({ data: { title: 'Title', _openid, createdAt: db.serverDate() } })
await db.collection('posts').where({ _openid: wx.getStorageSync('openid') }).get()
await db.collection('posts').doc(id).update({ data: { title: 'New Title' } })
await db.collection('posts').doc(id).remove()

4. Login & Cloud Function Authentication

Initialize the cloud environment on the Mini Program side; openid is obtained via the context inside the cloud function to avoid backend-frontend round-trips:

wx.cloud.init({ env: 'your-env-id', traceUser: true })
// Inside cloud function: const openid = cloud.getWXContext().OPENID

5. Optional: GitHub Actions Publishing

Tell the Agent: “Configure GitHub Actions for automatic publishing,” and it should refer to references/ci-cd.md. If the project requires upload for review, the documentation lists the optional dependency miniprogram-ci:

npm install miniprogram-ci -D

When encountering errors, the Skill suggests first checking the “Common Error Handling” table, then reading the corresponding reference’s Common Mistakes, or asking the Agent to “Check the error ledger for this skill.”

Use Cases & Notes

Who is it for

  • Developers already using Coding Agents to write WeChat Mini Programs who want to reduce time spent on documentation searching, deprecated APIs, and subpackage pitfalls.
  • Mid-to-large-scale Mini Programs requiring “parallel lines” such as Cloud Development, payment, subscription messages, and content security, hoping for the Agent to reference unified templates by module.

Preparation (Platform-side items listed by the Skill)

  • WeChat Developer Tools, Mini Program AppID, Cloud Development environment; Merchant Number for payment scenarios; Optional GitHub repository and miniprogram-ci for CI/CD scenarios.
  • Account registration and real-name authentication must be completed by the individual on the WeChat Public Platform; the Skill only covers the code and configuration layer.

Limitations & Pitfalls

  • Do not port Web login pages directly to Mini Programs; for avatars and nicknames, use chooseAvatar and type="nickname", do not rely on the deprecated getUserInfo / getUserProfile.
  • Inside cloud functions, it is advisable to use cloud.DYNAMIC_CURRENT_ENV for environment IDs; the Mini Program side wx.cloud.init requires a string environment ID.
  • Do not directly require cross-package components between subpackages; use cloud functions or eventBus for decoupling.
  • The Skill’s self-described “Self-Evolution” writes to error-log.md; if a team forks or redistributes it, they must review changes themselves.

Conclusion

Wechat Miniprogram Toolkit breaks down high-frequency WeChat Mini Program capabilities into searchable references, accompanied by subpackage analysis scripts and an error ledger, making it suitable as a long-term development manual for the Agent side. If you wish to view details or install on SkillHub, you can open: https://api.skillhub.cn/user_64e5b706/wechat-miniprogram-toolkit

羽毛球分组比赛记分
小程序二维码

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

Xiaoye