Miniprogram Development logo

Miniprogram Development

Community
zhaoxuya520
miniprogram-development

小程序开发时使用。覆盖微信/支付宝/抖音小程序 + Taro/uni-app 多端统一开发。

Overview

Publisherzhaoxuya520
RepositoryAI-Fullstack-Delivery-Workflow
Skill nameminiprogram-development
Stars
56
Forks
18
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by zhaoxuya520 on GitHub. Read the source before you install it.

Installation

Install the Miniprogram Development AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow/tree/master/workflows/frontend-engineer/skills/miniprogram-development
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow.git /tmp/AI-Fullstack-Delivery-Workflow
mkdir -p .claude/skills
cp -r /tmp/AI-Fullstack-Delivery-Workflow/workflows/frontend-engineer/skills/miniprogram-development .claude/skills/miniprogram-development
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Miniprogram Development in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Miniprogram Development on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Miniprogram Development is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

小程序开发(Miniprogram Development)

适用场景

  • 微信小程序开发(原生 / Taro / uni-app)
  • 支付宝小程序 / 抖音小程序 / 百度小程序
  • 多端统一开发(一套代码多端发布)
  • 小程序性能优化
  • 小程序与 H5 互通

与其他 skill 的分工

场景用什么
小程序页面/组件/多端本 skill
Web 页面(纯浏览器)component-architecture/
APP 原生(React Native/Flutter)mobile-hybrid/
状态管理通用方法state-management/
API 调用/缓存data-fetching/

技术栈选型

text
┌─ 小程序框架决策树 ─────────────────────────────────────────┐
│                                                             │
│  Q1: 只做微信小程序?                                       │
│    是 → 微信原生(最佳性能 + 最新 API)                      │
│    否 → Q2                                                  │
│                                                             │
│  Q2: 团队技术栈?                                           │
│    React → Taro 3(京东出品,React/Vue 均支持)             │
│    Vue → uni-app(DCloud,Vue 生态 + 最多端)              │
│    都行 → Taro(社区更活跃) 或 uni-app(端更多)          │
│                                                             │
│  Q3: 需要同时出 APP?                                       │
│    是 → uni-app(支持编译到 APP)                           │
│    否 → Taro(小程序 + H5 足够)                           │
└─────────────────────────────────────────────────────────────┘

框架对比

框架语法多端覆盖性能生态适合
微信原生WXML+WXSS+JS仅微信最佳微信组件只做微信且性能敏感
Taro 3React/Vue微信/支付宝/抖音/H5/RN良好京东+社区React 团队多端
uni-appVue 2/3微信/支付宝/抖音/百度/H5/APP良好DCloudVue 团队 + 需要 APP
RemaxReact多端良好蚂蚁React 纯粹

项目结构(Taro)

text
src/
├── app.config.ts          # 全局配置(pages/tabBar/window)
├── app.ts                 # 入口
├── pages/
│   ├── index/
│   │   ├── index.tsx      # 页面组件
│   │   ├── index.config.ts # 页面配置
│   │   └── index.module.scss
│   └── user/
│       └── ...
├── components/            # 通用组件
├── services/              # API 调用
├── stores/                # 状态管理
├── utils/                 # 工具函数
└── assets/                # 静态资源

核心开发模式

页面生命周期

typescript
// Taro React 页面
import { useDidShow, useDidHide, useShareAppMessage } from '@tarojs/taro';

function IndexPage() {
  // 页面显示(每次切回来都触发)
  useDidShow(() => { console.log('页面显示'); });
  
  // 页面隐藏
  useDidHide(() => { console.log('页面隐藏'); });
  
  // 分享
  useShareAppMessage(() => ({
    title: '分享标题',
    path: '/pages/index/index',
    imageUrl: 'share.png',
  }));
  
  return <View>...</View>;
}

网络请求封装

typescript
// services/request.ts
import Taro from '@tarojs/taro';

const BASE_URL = process.env.TARO_APP_API_URL;

export async function request<T>(options: {
  url: string;
  method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
  data?: any;
  needAuth?: boolean;
}): Promise<T> {
  const { url, method = 'GET', data, needAuth = true } = options;
  
  const header: Record<string, string> = {
    'Content-Type': 'application/json',
  };
  
  if (needAuth) {
    const token = Taro.getStorageSync('token');
    if (token) header['Authorization'] = `Bearer ${token}`;
  }
  
  const res = await Taro.request({
    url: `${BASE_URL}${url}`,
    method,
    data,
    header,
    timeout: 10000,
  });
  
  if (res.statusCode === 401) {
    // Token 过期 → 跳登录
    Taro.navigateTo({ url: '/pages/login/index' });
    throw new Error('未授权');
  }
  
  if (res.statusCode >= 400) {
    throw new Error(res.data?.message || '请求失败');
  }
  
  return res.data as T;
}

登录流程(微信)

typescript
// 微信小程序登录标准流程
import Taro from '@tarojs/taro';

export async function wxLogin(): Promise<string> {
  // 1. 获取临时 code
  const { code } = await Taro.login();
  
  // 2. 发送 code 到后端换 token
  const { token } = await request<{ token: string }>({
    url: '/auth/wx-login',
    method: 'POST',
    data: { code },
    needAuth: false,
  });
  
  // 3. 存储 token
  Taro.setStorageSync('token', token);
  return token;
}

// 获取用户信息(需要用户授权按钮触发)
export async function getUserProfile() {
  const { userInfo } = await Taro.getUserProfile({
    desc: '用于完善个人资料',
  });
  return userInfo;
}

性能优化

text
首屏优化:
  □ 分包加载(subPackages,主包 < 2MB)
  □ 预加载分包(preloadRule)
  □ 骨架屏(首屏数据未到时展示)
  □ 数据预拉取(prefetchData)
  □ 图片懒加载(lazy-load)

渲染优化:
  □ 长列表虚拟化(RecycleView / VirtualList)
  □ setData 数据量最小化(diff 更新)
  □ 避免频繁 setData(合并更新)
  □ WXS / wxs 处理响应式交互(不过桥)

包大小优化:
  □ 主包 ≤ 2MB(超了必须分包)
  □ 总包 ≤ 20MB
  □ 图片用 CDN(不放本地)
  □ 按需引入组件库
  □ Tree-shaking 无用代码

组件库选型

组件库适配框架Stars适合
Vant Weapp原生/uni-app18K+移动端风格(有赞)
NutUITaro6K+京东风格
TDesign 小程序原生4K+腾讯风格
Arco Design MobileTaro-字节风格
uni-uiuni-app-DCloud 官方
WeUI原生27K+微信官方基础

常见坑

text
1. 主包超 2MB → 必须分包,图片上 CDN
2. setData 数据太大 → 页面卡顿(单次 < 256KB)
3. 不处理授权拒绝 → 用户拒绝后功能卡死
4. wx.navigateTo 层级超 10 → 用 redirectTo 或 reLaunch
5. 不做登录态检查 → Token 过期后白屏
6. 不适配 iOS 安全区 → 底部被遮挡
7. 不测试真机 → 模拟器正常真机崩溃
8. 不处理网络异常 → 断网无提示
9. 小程序审核被拒 → 提前看审核规范
10. 不做版本兼容 → 低版本基础库报错

配套模板

  • templates/miniprogram-template.md

与其他 skill 的协作

text
上游:
  ui-ux-designer → 小程序设计稿(注意平台规范差异)
  api-designer → API 契约

下游:
  testing-frontend → 小程序自动化测试(Miniprogram Automator)
  build-deploy → 小程序 CI(miniprogram-ci)

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Miniprogram Development AI skill do?

小程序开发时使用。覆盖微信/支付宝/抖音小程序 + Taro/uni-app 多端统一开发。

Why use Miniprogram Development on TypingMind?

Because you install it once and use it with any model. Miniprogram Development is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Miniprogram Development in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/zhaoxuya520/AI-Fullstack-Delivery-Workflow/tree/master/workflows/frontend-engineer/skills/miniprogram-development. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Miniprogram Development?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Miniprogram Development?

As many as you like. As long as a model supports skills, you can use Miniprogram Development with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Miniprogram Development AI skill free?

It is published on GitHub by zhaoxuya520. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇