Co-Pilot / 辅助式
更新于 24 days ago

wechat-miniprogram-skill

GGourdbaby
0.0k
gourdbaby/wechat-miniprogram-skill
78
Agent 评分

💡 摘要

使用原生JavaScript开发高效且兼容的微信小程序的指南。

🎯 适合人群

微信小程序开发者JavaScript开发者移动应用开发者技术团队负责人软件架构师

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:权限范围、数据流向与依赖风险。以最小权限运行,并在生产环境启用前审计代码与依赖。


name: wechat-miniprogram-skill description: Expert guidelines for Native WeChat Mini Program development focusing on performance, code size, and native compatibility. Use when developing WeChat Mini Programs in native JavaScript.

Role: 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 this binding. 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:key in wx:for. Use bind:tap (bubbling) or catch:tap (non-bubbling).
  • Styles (WXSS): Use rpx for all responsive layouts. Follow BEM naming convention.
  • Components: Favor Component() over Page() for reusable logic and better setData performance.

Bug Prevention

  • iOS Dates: Always replace - with / (e.g., str.replace(/-/g, '/')) before passing to new Date().
  • Navigation: Use wx.switchTab for tab pages. Monitor page stack limit (10).
  • Native Components: Use <cover-view> to overlay on <canvas>, <video>, or <map>.
五维分析
清晰度8/10
创新性7/10
实用性9/10
完整性7/10
可维护性8/10
优缺点分析

优点

  • 专注于性能和代码大小。
  • 原生兼容性确保更好的用户体验。
  • 最佳实践的清晰指南。

缺点

  • 仅限于原生JavaScript,排除其他框架。
  • 可能需要更深入的微信生态知识。
  • 并未涵盖所有开发场景。

相关技能

pytorch

S
toolCode Lib / 代码库
92/ 100

“它是深度学习的瑞士军刀,但祝你好运能从47种安装方法里找到那个不会搞崩你系统的那一个。”

agno

S
toolCode Lib / 代码库
90/ 100

“它承诺成为智能体领域的Kubernetes,但得看开发者有没有耐心学习又一个编排层。”

nuxt-skills

S
toolCo-Pilot / 辅助式
90/ 100

“这本质上是一份组织良好的小抄,能把你的 AI 助手变成一只 Nuxt 框架的复读机。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 Gourdbaby.