What does WeChat MiniApp Factory do?
WeChat MiniApp Factory: Codex skills to scaffold, validate, and pre-review WeChat Mini Programs before submission.
Overview
This skill provides a set of commands and workflows for AI agents to:
- Scaffold a new Mini Program project with a recommended file structure and configuration.
- Validate the project against WeChat's official guidelines and common pitfalls.
- Pre-review the code for potential issues before submitting to WeChat's review.
Usage
Scaffolding a New Project
Use the scaffold action to create a new Mini Program project:
scaffold --appid YOUR_APPID --name "My MiniApp"
This generates:
app.js,app.json,app.wxss- A
pages/directory with a sample page - A
utils/directory for helpers - A default
.gitignoreandREADME.md
Validation
Run validation against your current project:
validate --path ./miniprogram
The validation checks:
- Required files exist (app.js, app.json, app.wxss)
- Pages referenced in
app.jsonactually exist - No deprecated APIs from WeChat SDK are used
- Environment variables like
WX_APPIDare set
Pre-Review
Generate a pre-submission review report:
pre-review --path ./miniprogram
This will output a checklist of items to verify before submission, such as:
- Private keys exposed in code
- Hardcoded environment variables
- Missing privacy policy or user agreement pages
- Code issues flagged by WeChat's best practices
Continuous Integration
The skill can be integrated into CI/CD pipelines. Example GitHub Actions workflow snippet:
name: MiniApp CI
on: [push]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Validate Mini Program
run: npx wechat-miniapp-factory validate
Configuration
Set the following environment variables:
| Variable | Description | Required |
|---|---|---|
WX_APPID | Your WeChat Mini Program App ID | Yes |
WX_APP_SECRET | WeChat App Secret (for API calls) | No |
Supported Platforms
This skill is designed for use with:
- Claude Code (Anthropic)
- Cursor (Cursor AI)
- Codex (GitHub Copilot)
License
MIT