Develop wechat ai miniprograms
Build, diagnose, validate, and release WeChat Mini Programs, including optional AI Mode Skills and CloudBase backends. Use when creating or modifying mini-program source, authoring an AI Skill under skills/, designing atomic APIs and components, configuring cloud functions, verifying natural-language routing, operating WeChat DevTools, choosing between Computer Use, Chrome, CLI, and user handoff, handling privacy or certification findings, uploading a development version, or guiding review and publication.From its SKILL.md
npx -y skills add iajihga/develop-wechat-ai-miniprogramsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.6 KB, ~1.7k tokens by cl100k_base, as published. Nobody here has run it
Develop WeChat Mini Programs
Deliver a working mini-program, not only source files. Keep the ordinary mini-program, AI Skill, cloud backend, factual data, and release configuration consistent and test them as separate layers before an end-to-end test.
Not every project uses every layer. Skip the AI Skill and CloudBase sections when the project has no skills/ directory or no backend; the project baseline, layered validation, privacy scan, and release stages apply to any mini-program.
Start with current facts
- Inspect the existing project before planning. Read
project.config.json,app.json,page-meta.json,skills/*/SKILL.md,skills/*/mcp.json, cloud configuration, and release artifacts. - Confirm the subject type, AppID, selected service category, certification state, cloud environment, DevTools version, and intended release stage.
- Verify changing platform rules, prices, product capabilities, review requirements, and official APIs against current primary WeChat or Tencent sources. Do not rely on remembered pricing.
- Separate factual claims into:
- stable local facts from source code or CLI output;
- current external facts verified from official sources;
- inferences that must be labeled as such.
Route work to the right tool
Use the narrowest reliable interface:
| Work | Preferred interface |
|---|---|
| Search, edit, validate, inspect JSON, run tests | Shell plus apply_patch |
| DevTools CLI preview, upload, CloudBase status | WeChat DevTools CLI |
| Native WeChat DevTools UI, AI compile panel, QR/login panel | computer-use:computer-use through node_repl |
| Official documentation and ordinary web pages | Web browsing or chrome:control-chrome |
| WeChat public-platform backend when Chrome automation works | chrome:control-chrome |
| QR scans, phone confirmations, CAPTCHA, blocked admin UI | User handoff |
Read references/tool-routing.md before any GUI work. Never use Computer Use for Chrome when the Chrome skill is available. If the WeChat admin backend resists automation, stop clicking blindly and give the user exact copy/paste or click instructions.
Follow the delivery workflow
1. Define the first useful scenario
Choose one bounded, decision-oriented scenario. Prefer requests with explicit inputs and structured outputs, such as finding, comparing, calculating, checking availability, or assessing risk. Avoid an unfocused directory of content.
Define:
- user utterances that should invoke the Skill;
- utterances that should not invoke it;
- required filters and identifiers;
- which facts are static, sourced, predicted, or live;
- safety boundaries and fallback behavior.
2. Build the ordinary mini-program
Implement a useful non-AI path first: home/list, filtering, detail, source attribution, loading, empty, and failure states. Keep a user-visible path to the same entities returned by the AI Skill.
Use subpackages when they clarify boundaries. Include the skills directory in the uploaded code package. Keep generated validation artifacts out of the package with packOptions.ignore and watch ignores.
3. Build the AI Skill contract
Create one Skill directory per coherent capability:
skills/<skill>/
├── SKILL.md
├── mcp.json
├── index.js
├── apis/
├── components/
├── data/ or adapters/
└── utils/
Register each atomic API with wx.modelContext.registerAPI. Make API names, mcp.json, index.js, and implementation filenames agree exactly.
Design atomic APIs around model decisions:
- Search or list candidates.
- Fetch detail using an ID returned by search.
- Compare two or three known IDs only when the user asks.
Return both a short model-facing message and structuredContent. Use stable IDs; never ask the model to invent identifiers from names. Put explicit routing rules, negative scope, relative-date conversion, and safety constraints in the Skill instructions and API descriptions.
Read references/ai-skill-sop.md when creating or changing a Skill contract.
4. Add current data through a backend
Treat the mini-program code as the frontend. Use CloudBase or another compliant backend for secrets, third-party requests, dynamic data, and server-side normalization.
For CloudBase:
- Create or select an environment.
- Write the environment ID to every runtime config that actually uses it.
- Initialize
wx.cloudonce. - Deploy the cloud function and install dependencies in the cloud.
- Verify function status and timeout with the CLI or console.
- Call it from both the ordinary page path and the AI Skill adapter.
- Return an explicit unavailable state when the upstream service fails or a date is outside the supported window. Never fabricate fresh data.
Use a server-side proxy when a third-party domain cannot satisfy WeChat request-domain requirements. Do not expose AppSecret or third-party credentials in the mini-program package.
Read references/build-and-cloud-sop.md for the complete implementation sequence.
5. Validate in layers
Do not jump directly to natural-language chat.
- Run syntax and local tests.
- Run
scripts/preflight.mjs <project>from this Skill repository. It checks any mini-program; add--strict-privacybefore a release build and--require-skillswhen the project is supposed to declare an AI Skill. Resolve every error, judge every warning, and manually verify every info finding. - Run the current official or project-provided Skill validator.
- Execute every atomic API directly with representative valid, empty, invalid-ID, and out-of-window inputs.
- Inspect atomic UI components for overflow and truncation.
- Compile the ordinary mini-program and test the page path.
- Switch DevTools to AI compile mode and send a natural-language prompt.
- Confirm every proposed API call and inspect parameters, structured output, final answer, and mini-program handoff.
Record exact evidence: validator counts, build stage, API inputs, returned IDs, upstream data timestamps, cloud function status, package size, and upload version.
6. Release in distinct stages
Treat these as different states:
local source -> preview -> uploaded development version -> experience version
-> submitted for review -> approved -> published
Uploading a development version is not public release. Do not claim the mini-program is online until the backend shows a published version.
Before upload:
- check certification, filing, category, privacy declaration, and current subject restrictions;
- scan for privacy-sensitive APIs and ensure every call is intentional;
- remove convenience-only privacy APIs when a plain UI alternative is sufficient;
- verify the cloud function is deployed independently of the frontend upload;
- increment the version and write a precise description.
After upload, have the user configure or scan the experience version when backend automation is unavailable. Run a phone regression before review. Read references/release-sop.md.
Diagnose by layer
When a test fails, identify the first broken boundary:
- DevTools account and compile mode.
- AI model routing.
- Atomic API registration and schema.
- API implementation.
- Cloud function invocation.
- Upstream data provider.
- Atomic component rendering.
- Page handoff.
- Admin review configuration.
Do not rewrite working Skill logic because the DevTools account is logged out. Do not change cloud code because only the admin backend is blocking a button. Read references/troubleshooting.md for observed symptoms and proven checks.
Preserve operating evidence
Keep machine-readable results outside the upload package. A practical artifact folder contains:
- validator report;
- direct API execution results;
- component render snapshots;
- end-to-end test notes;
- upload result and package sizes;
- a short release report listing passed checks, limitations, and next stage.
Never store QR codes, access tokens, AppSecret, personal identity materials, or cloud credentials in the repository.
What ships with it: 13 files
58.9 KB alongside SKILL.md, 2 of them executable
agents/
- openai.yaml294 B
references/
- ai-skill-sop.md6.8 KB
- build-and-cloud-sop.md5.5 KB
- commands.md2.7 KB
- release-sop.md4.7 KB
- tool-routing.md5.5 KB
- troubleshooting.md5.0 KB
scripts/
- preflight.mjsruns12.0 KB
- preflight.test.mjsruns5.7 KB
- .gitignore30 B
- LICENSE1.0 KB
- package.json912 B
- README.md8.7 KB