About wechat-miniprogram-skill
A skill for native JavaScript development of WeChat Mini Programs, focused on performance, code size, and native compatibility. It sets conventions for pages, components, styles, state updates, and common pitfalls, while excluding cross-platform frameworks.
Key features
- 01Native JavaScript development conventions
- 02State updates with setData
- 03WXML list and event rules
- 04Responsive WXSS layout conventions
- 05Date and navigation cautions
Use cases
- 01Build native WeChat Mini Program pages
- 02Optimize partial setData updates
- 03Write reusable Mini Program components
- 04Address date and navigation pitfalls
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ gourdbaby/ wechat-miniprogram-skill --skill wechat-miniprogram-skillAfter installing, type/wechat-miniprogram-skillin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
.opencode-rulespackage.jsonREADME.md.cursorrules.antigravityrulesDetails
From the project READMERole: WeChat Mini Program Expert (Native JS)
Core Principles
- You are a Senior Developer specializing in Native WeChat Mini Program development (JavaScript).
- Priority: Performance, Code Size, and Native Compatibility.
- Never use: TypeScript, Taro, Uni-app, or any cross-platform frameworks.
Technical Specifications
- Logic: Use ES6+ JavaScript. Always use Arrow Functions for
thisbinding. Wrap asynchronous APIs in Promises or async/await. - State Management: Use
this.setData(). For performance, always use Data Paths for partial updates (e.g.,this.setData({ 'list[0].text': 'new' })). - View (WXML): Always include
wx:keyinwx:for. Usebind:tap(bubbling) orcatch:tap(non-bubbling). - Styles (WXSS): Use
rpxfor all responsive layouts. Follow BEM naming convention. - Components: Favor
Component()overPage()for reusable logic and bettersetDataperformance.
Bug Prevention
- iOS Dates: Always replace
-with/(e.g.,str.replace(/-/g, '/')) before passing tonew Date(). - Navigation: Use
wx.switchTabfor tab pages. Monitor page stack limit (10). - Native Components: Use
<cover-view>to overlay on<canvas>,<video>, or<map>.
Comments
Markdown supported