ai-model-wechat
Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, 企业微信小程序, wx.cloud apps). Features generateText and streamText with callbacks (onText, onEvent, onFinish). Models via wx.cloud.extend.AI.createModel with groups hunyuan-exp (小程序成长计划), cloudbase (main managed), or custom-*. Model IDs (deepseek-v4-flash, deepseek-v3.2, hunyuan-2.0-instruct-20251111, glm-5, kimi-k2.6) go in the data wrapper model field. API differs from JS/Node SDK — streamText needs data wrapper, generateText returns raw response. MUST run two-step preflight before code — see body. Keywords: Mini Program AI, w
npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill ai-model-wechat --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Instructs an AI agent to call WeChat Mini Program AI models through wx.cloud.extend.AI, choosing a provider (hunyuan-exp or cloudbase) and a concrete model ID placed in the data field. It includes two-step preflight: ① Billing Eligibility (determine whether to use hunyuan-exp or cloudbase) and ② Group Readiness (enable the target model in DescribeAIModels / DescribeManagedAIModelList / UpdateAIModel). It also covers how to query and enable models, and cautions against using non-supported provider names or model IDs in createModel.
How it works
- Before code: perform Mandatory Two-Step Preflight in order: ① Billing Eligibility by querying env and enrollment (growth plan vs token credits) and selecting provider: "hunyuan-exp" for Growth Plan or "cloudbase" for Token Credits; the chosen path determines default or selectable models. ② Group Readiness: query DescribeAIModels for the EnvId; if the target model is not present, query DescribeManagedAIModelList to find the correct Model string, then enable via UpdateAIModel with Status: 1 and a full replacement Models[] including the target model. Only after both steps pass, instruct to write wx.cloud.extend.AI.createModel("<GroupName>") and ensure the data field contains a valid model.
- It instructs exact provider/model separation: provider (GroupName) goes into createModel("provider"), while the concrete model id goes into data: { model: "..." } within streamText/generateText calls.
- It defines the three legal provider shapes and shows example patterns for both hunyuan-exp and cloudbase usage with the proper data.model field.
When to use it
Use this skill for calling AI models in WeChat Mini Program using wx.cloud.extend.AI. Use when you need to generate or stream text with onText / onEvent / onFinish callbacks, and when selecting models from either the Growth Plan or the main managed cloudbase group. Do not use for browser/Web, Node.js backend, or image generation in Mini Program contexts.
What it can touch
- It references and uses CloudBase API calls through the tcb service: DescribeAIModels, DescribeManagedAIModelList, UpdateAIModel, DescribeEnvPostpayPackage, CreateAIModel. It requires EnvId, GroupName, Model, and data structures like { model: "...", messages: [...] } for streamText/generateText. Commands and file names are quoted exactly as in the skill, e.g. wx.cloud.extend.AI.createModel, DescribeAIModels, UpdateAIModel, DescribeManagedAIModelList, DescribeAIModels, DescribeEnvPostpayPackage.
Caveats
- The provider argument to wx.cloud.extend.AI.createModel(provider) must be one of three legal shapes: "hunyuan-exp", "cloudbase", or "custom-<name>". Do not pass model IDs in the provider slot. The model ID goes into the data.wrapper field as { model: "..." }.
- The two-step preflight must be completed before any business code is written.
- Enabling models requires full replacement of the Models[] array in UpdateAIModel (not incremental).
- The skill distinguishes between Growth Plan vs Token Credits, and warns to enable the exact target model before invocation; otherwise ModelNotEnabled errors may occur.
## Sibling skills (local only) Sibling CloudBase skills ship beside this skill. Use local relative paths such as `../auth-tool-cloudbase/SKILL.md`. If a referenced sibling skill file is missing from this environment, ask the user to install the full CloudBase plugin (or the missing skill). Do **not** HTTP-fetch remote skill or protocol markdown into the agent context. ## When to use this skill Use this skill for **calling AI models in WeChat Mini Program** using `wx.cloud.extend.AI`. **Use it when you need to:** - Integrate AI text generation in a Mini Program - Stream AI responses with callback support - Call Hunyuan models from the WeChat environment **Do NOT use for:** - Browser/Web apps → use `ai-model-web` skill - Node.js backend or cloud functions → use `ai-model-nodejs` skill - Image generation → use `ai-model-nodejs` skill (not available in Mini Program) - Runtimes without a CloudBase SDK (native apps, Python, etc.) → use `http-api-cloudbase` skill (it now includes the `ai_model` OpenAPI spec for direct HTTP calls) --- ## ⛔ STOP — `wx.cloud.extend.AI.createModel(provider)` argument is **not** a vendor / model name Read this before writing any `createModel(...)` line. Agents
- Sibling skills (local only)
- When to use this skill
- ❌ Do NOT write any of these — they are all wrong
- ✅ Correct pattern — provider vs model are two different fields
- Decision procedure (when the user names a specific model)
- Mandatory Two-Step Preflight
- Preflight ① · Billing Eligibility (two parallel billing paths)
- Preflight ② · Group Readiness (mandatory for every Mini Program AI call)
- Available Providers and Models
- A. 小程序成长计划 exclusive (default when enrolled)
- B. Main managed group (Token Credits pack scenario, recommended default)
- C. Not in the managed catalog → Custom onboarding
- Custom Onboarding (when not in the managed catalog)
- Prerequisites
What does the ai-model-wechat skill do?
Use this skill for WeChat Mini Program AI via wx.cloud.extend.AI (小程序, 企业微信小程序, wx.cloud apps). Features generateText and streamText with callbacks (onText, onEvent, onFinish). Models via wx.cloud.extend.AI.createModel with groups hunyuan-exp (小程序成长计划), cloudbase (main managed), or custom-*. Model IDs (deepseek-v4-flash, deepseek-v3.2, hunyuan-2.0-instruct-20251111, glm-5, kimi-k2.6) go in the data wrapper model field. API differs from JS/Node SDK — streamText needs data wrapper, generateText returns raw response. MUST run two-step preflight before code — see body. Keywords: Mini Program AI, w
How do I install it?
Run `npx skills add TencentCloudBase/CloudBase-AI-Toolkit --skill ai-model-wechat --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From TencentCloudBase/CloudBase-AI-Toolkit, a repository with 1,066 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
