develop-uniapp-miniapp
Skill3 starsChanged 15 days agoApache-2.0View on GitHub
Build, scaffold, and extend uni-app (Vue 3) WeChat mini-program frontends with a Tailwind-first, local-first workflow. Use for page changes, complete feature slices, frontend foundation (page shell, modal, request/session, scroll/list, tabbar, subpackages), and prototype-to-miniapp work in confirmed uni-app repos, or when the user asks to create or migrate to uni-app. Do not use for native WeChat mini-program repos (`app.json`, `Page()`, `.wxml`) without uni-app markers.
In this repository11 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- codebase-designSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- frontend-designSkill
- git-auto-commitSkill
- github-cli-opsSkill
- harness-engineeringSkill
- release-opsSkill
- tddSkill
- wechat-miniprogram-ci-uploadSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Treat the repo as confirmed uni-app only when at least two strong signals are present and at least one is framework-specific:
- Very specific: line 27
Read the root agent instructions (AGENTS.md, CLAUDE.md) and DESIGN.md when present.
- Distinctive: line 28
If a prototype, HTML mock, image, or Figma handoff exists for the surface, it is the visual source of truth.
- Very specific: line 31
Before finishing, run the project's type-check and lint scripts with its package manager, plus a real target build such as pnpm …
- Distinctive: line 43
Do not rewrite unrelated existing code to satisfy this skill.
- Distinctive: line 45
Do not turn project-specific brands, business nouns, headers, protocols, route maps, or component prefixes into generic conventions, and do …
- Very specific: line 53
Keep at most one global modal capability.
- Very specific: line 54
Keep startup pages, tabBar pages, and package-shared resources in the main package.
- Very specific: line 58
Default to WeChat behavior.
- Distinctive: line 59
Do not draw the WeChat menu capsule in page UI.
- Very specific: line 60
Use icon fonts or SVG for icons, never raw characters like >, <, or x.
- Very specific: line 64
Do not add translateY lift to active tabbar items unless asked.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Develop Uniapp Miniapp
Deliver uni-app mini-program frontend work, from narrow fixes to complete feature slices, without rewriting unrelated existing code.
Detect The Project First
Treat the repo as confirmed uni-app only when at least two strong signals are present and at least one is framework-specific:
package.jsondepends on@dcloudio/uni-*- the build config uses
@dcloudio/vite-plugin-unior another@dcloudiobuild plugin manifest.jsonorsrc/manifest.jsonexistspages.jsonorsrc/pages.jsonexistsApp.vueorsrc/App.vueexists
Native WeChat signals (app.json, app.js, project.config.json, Page()/Component() with .wxml/.wxss, @vant/weapp, native custom-tab-bar/, subpackage folders) do not confirm uni-app. For a native repo, stop using this skill unless the user explicitly asks for a uni-app scaffold or migration.
An empty target (no files, or only .git, .gitignore, .DS_Store, editor metadata) plus an explicit create request means bootstrap mode; see references/project-bootstrap.md.
Workflow
- Confirm the project type with the detection rules above.
- Read the root agent instructions (
AGENTS.md,CLAUDE.md) andDESIGN.mdwhen present. Create instruction files only for requested bootstrap or documentation work; seereferences/activation-and-agents.md. - If a prototype, HTML mock, image, or Figma handoff exists for the surface, it is the visual source of truth.
- Choose a capability mode (below), then read only the references that task needs.
- Apply these rules to new code and to existing code the user asked to change.
- Before finishing, run the project's
type-checkandlintscripts with its package manager, plus a real target build such aspnpm build:mp-weixin. Type-check and lint alone miss SFC-shape and compile-time integration failures.
Capability Modes
- Small change: isolated fix, one page, or a visual tweak. Keep the blast radius tight, follow the existing route style, and add no global abstractions.
- Feature slice: a complete feature, page family, workflow, or "finish this module". Read
references/feature-slice-delivery.mdand deliver routes, route-local components/hooks, mock/API adapters, shared stores, scroll/list behavior, loading/empty/error states, and navigation together. - Frontend foundation: an empty, early, or prototype-led repo that lacks primitives the requested work needs. Read
references/mature-miniapp-patterns.md. Reuse existing primitives first, and add only the missing pieces (PageLayout, one global modal, one request/session path, one scroll/list path, one tabbar path) that the feature directly needs. - Prototype translation: translate the artifact's visual hierarchy first, then choose the smallest component/hook split that stays maintainable. Do not substitute template styling unless the user asks for a redesign.
Hard Rules
Scope and reuse
- Do not rewrite unrelated existing code to satisfy this skill.
- Reuse the repo's existing request client, page shell, list controller, upload/feedback helpers, realtime manager, modal, and subscription helpers instead of adding parallel wrappers.
- Do not turn project-specific brands, business nouns, headers, protocols, route maps, or component prefixes into generic conventions, and do not hardcode reference-project paths.
- Preserve the declared package manager and lockfile; use
pnpmonly for a new project with no established choice.
Structure
- New Vue SFCs use
<script setup lang="ts">. - Local-first: page-only UI goes in the route's
components/, page-only orchestration in itshooks/, and static or prototype data in itsdata.ts. Promote code tosrc/componentsorsrc/hooksonly when it is reused across routes and stays generic. App.vueis theAppShellfor app lifecycle, global styles, and global UI hosts. It must keep a non-empty<script>or<template>block.- New route pages use the shared
PageLayout, or the repo's existing shell when that already fills the role. - Keep at most one global modal capability. Reuse the existing one; add
AppModal+modalStore+useAppModalonly when the requested work needs app-wide prompts. - Keep startup pages,
tabBarpages, and package-shared resources in the main package. - Custom events are declared in camelCase in script (
emit('quickAction')) and listened to with hyphens in templates (@quick-action).
Mini-program UI
- Default to WeChat behavior. Add no
#ifdef/#ifndefor platform branches unless multi-platform is requested or already required. - Do not draw the WeChat menu capsule in page UI; align surrounding navigation around the native capsule.
- Use icon fonts or SVG for icons, never raw characters like
>,<, orx. - Visible text is at least
20rpx. - New
scroll-views useshow-scrollbar="false". Put horizontal padding on an inner full-widthview, not on a verticalscroll-view(that overflows in WeChat). Keep one vertical scroll surface per region. - Height chains: fixed sections use
shrink-0, scroll parentsmin-h-0, direct scroll slotsflex-1 h-0. Use measured height for sticky-plus-nested layouts. - Do not add
translateYlift to active tabbar items unless asked. - Custom bottom navigation defaults to a shared Vue
AppTabbarmounted through the page shell. Use officialcustom-tab-bar/(native files, not.vue) only when the repo already uses it or the user asks. - With no UI source, match the current page; for visual-heavy tasks use
frontend-design.
Delegation
- CI upload, preview QR, or 体验版/开发版 upload: use
wechat-miniprogram-ci-upload. Commits and pushes:git-auto-commit. Release promotion and tags:release-ops. - Initialize Git only for a requested bootstrap or Git setup.
References
| Task | Read |
| Layering and where new code belongs | references/architecture.md |
| Complete feature or page family | references/feature-slice-delivery.md |
| Foundation patterns from mature apps | references/mature-miniapp-patterns.md |
| New project from an empty directory | references/project-bootstrap.md, references/activation-and-agents.md |
App shell, PageLayout, bottom slots, overlay hosts | references/app-shell-and-page-layout.md |
| Adding pages (list, form, detail, chat, tabbed) | references/page-recipes.md |
| Vue pages, components, hooks, events | references/vue-best-practices.md |
| Main package vs subpackage vs independent, preload | references/subpackage-strategy.md |
scroll-view, refresher, anchored chat scroll | references/scroll-view-patterns.md, references/flex-layout-rules.md |
| Tabbed scroll, pull-refresh, load-more, gestures | references/interaction-containers.md |
Bottom navigation, badges, custom-tab-bar/ | references/custom-tabbar.md |
| Global modal, confirm, bottom sheet | references/global-modal.md |
| Tailwind, sizing, tokens | references/tailwind-usage.md |
| Icons and fonts | references/icons-and-fonts.md |
| Login, session, request, retry, upload | references/auth-and-transport.md |
| WebSocket, unread counts, chat | references/realtime-communication.md |
| Subscription messages | references/message-subscription.md |
| Share, capsule, permissions, safe area, platform | references/wechat-adaptation.md |
| New hook, util, or wrapper | references/custom-wrappers.md, references/decoupling-rules.md |
| Adding dependencies | references/third-party-usage.md |
Templates
assets/templates/ holds thin starting points. Rename them to the repo's existing equivalents when those already exist.
project-starter/is a runnable starter and the canonical source forApp.vue,PageLayout.vue,AppModal.vue,stores/modal.ts, andhooks/useAppModal.ts; copy those files from here when an existing repo needs them.page-with-local-hooks/is a route with localcomponents/andhooks/.- Pages:
feature-slice-page.vue,paged-list-page.vue,form-page.vue,subscription-center.vue. - Scroll and lists:
app-scroll.vue,pull-refresh-indicator.vue,tab-scroll-container.vue,use-paged-list.ts,use-load-more-observer.ts,use-refresh-pull.ts,use-anchored-scroll.ts. - Navigation:
app-tabbar.vue,tabbar-config.ts. - Transport and state:
request-client.ts,session-store.ts,websocket-client.ts,use-realtime-events.ts,use-subscription.ts.
Maintaining This Skill
After editing anything under assets/templates/, run scripts/check-templates.sh. It scaffolds the starter into a temp directory, adds the standalone templates, and requires build:mp-weixin, type-check, and lint to pass. uni-app currently pins Vite 5.2.8, so unplugin-vue-components 32 (ESM-only) and weapp-tailwindcss 5 (renamed exports) need a migration before they can be upgraded.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

