Miniprogram Development
by @binggg
WeChat Mini Program development skill for building, debugging, previewing, testing, publishing, and optimizing mini program projects. This skill should be us...
clawhub install miniprogram-development๐ About This Skill
name: miniprogram-development description: WeChat Mini Program development skill for building, debugging, previewing, testing, publishing, and optimizing mini program projects. This skill should be used when users ask to create, develop, modify, debug, preview, test, deploy, publish, launch, review, or optimize WeChat Mini Programs, mini program pages, components,
tabBar, routing, navigation, icon assets, project structure, project configuration, project.config.json, appid setup, device preview, real-device validation, WeChat Developer Tools workflows, miniprogram-ci preview/upload flows, or mini program release processes. It should also be used when users explicitly mention CloudBase, wx.cloud, Tencent CloudBase, ่
พ่ฎฏไบๅผๅ, or ไบๅผๅ in a mini program project.
version: 2.18.0
alwaysApply: false
Standalone Install Note
If this environment only installed the current skill, start from the CloudBase main entry and use the published cloudbase/references/... paths for sibling skills.
https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/SKILL.mdhttps://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/miniprogram-development/SKILL.mdKeep local references/... paths for files that ship with the current skill directory. When this file points to a sibling skill such as auth-tool or web-development, use the standalone fallback URL shown next to that reference.
Activation Contract
Use this first when
Read before writing code if
wx.cloud, CloudBase mini programs, OPENID, or mini program deployment/debug workflows.Then also read
../auth-wechat/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/auth-wechat/SKILL.md)../no-sql-wx-mp-sdk/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/no-sql-wx-mp-sdk/SKILL.md)../ui-design/SKILL.md (standalone fallback: https://cnb.cool/tencent/cloud/cloudbase/cloudbase-skills/-/git/raw/main/skills/cloudbase/references/ui-design/SKILL.md) firstDo NOT use for
Common mistakes / gotchas
wx.cloud projects.When to use this skill
Use this skill for WeChat Mini Program development when you need to:
Do NOT use for:
web-development)cloudrun-development or cloud-functions as appropriate)ui-design)How to use this skill (for a coding agent)
1. Start with the general mini program workflow - Treat WeChat Mini Program development as the default scope - Do not assume the project uses CloudBase unless the user or codebase indicates it
2. Follow mini program project conventions
- Keep mini program source under the configured mini program root
- Ensure page files include the required configuration file such as index.json
- Check project.config.json before suggesting preview or IDE workflows
3. Route by scenario
- If the task involves CloudBase, wx.cloud, cloud functions, CloudBase database/storage, or CloudBase identity handling, read CloudBase integration reference
- If the task involves debugging, previewing, publishing, WeChat Developer Tools, or no-DevTools workflows, read debug and preview reference
- If the task involves tabBar, icon assets, or label spacing, prefer the text-only custom tabBar default below unless the user explicitly requires icons
4. Use CloudBase rules only when applicable - CloudBase is an important mini program integration path, but not a universal requirement - Only apply CloudBase-specific auth, database, storage, or cloud function constraints when the project is using CloudBase
5. Recommend the right preview/debug path
- Prefer WeChat Developer Tools for simulator, panel-based debugging, preview, and real-device validation
- If WeChat Developer Tools is unavailable, use miniprogram-ci for preview, upload, and npm build workflows where appropriate
WeChat Mini Program Development Rules
General Project Rules
1. Project Structure
- Mini program code should follow the project root configured in project.config.json
- Keep page-level files complete, including .json configuration files
- Ensure referenced local assets actually exist to avoid compile failures
2. Configuration Checks
- Check project.config.json before opening, previewing, or publishing a project
- Confirm appid is available when a real preview, upload, or WeChat Developer Tools workflow is required
- Confirm miniprogramRoot and related path settings are correct
3. Resource Handling
- For tabBar, prefer a text-only custom tabBar by default when the user does not explicitly need icons. This avoids icon asset handling, removes reserved icon space, and makes the label area easier to align.
- Only generate local icon assets and configure iconPath / selectedIconPath when the user explicitly asks for tab icons or the design requires them.
- When generating local asset references such as icons, ensure the files are downloaded into the project.
- Keep file paths stable and consistent with mini program config files.
Recommended default for simple tabBar
Use tabBar.custom = true, keep only pagePath and text in app.json, and render text-only items in the custom component so there is no icon slot and no extra blank area above the label.
app.json
{
"tabBar": {
"custom": true,
"list": [
{ "pagePath": "pages/index/index", "text": "้ฆ้กต" },
{ "pagePath": "pages/travel/travel", "text": "่ก็จ" },
{ "pagePath": "pages/my/my", "text": "ๆ็" }
]
}
}
Keep the custom tabBar layout text-only, and use flex centering or matching height and line-height to remove the blank area above the label. Switch to downloaded local icons only when the user explicitly wants icon-based tabs.
CloudBase as a Mini Program Sub-Scenario
wx.cloud, Tencent CloudBase, ่
พ่ฎฏไบๅผๅ, or ไบๅผๅ, follow the CloudBase integration referencewx.cloud APIs and CloudBase environment configuration appropriatelyDebugging, Preview, and Publishing
miniprogram-ci as the fallback path for preview, upload, and npm build-related automationMinimal project skeleton
app.js
App({
onLaunch() {
console.log("Mini Program launched");
},
});
pages/index/index.js
Page({
data: {
message: "Hello CloudBase Mini Program",
},
});
pages/index/index.wxml
{{message}}
pages/index/index.json
{
"navigationBarTitleText": "Home"
}
project.config.json
{
"appid": "your-mini-program-appid",
"projectname": "cloudbase-mini-program",
"miniprogramRoot": "./",
"compileType": "miniprogram"
}