wevu-best-practices
- Repo stars 339
- Author updated Live
- Author repo weapp-vite
- Domain
- Data
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @weapp-vite · no license declared
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: wevu-best-practices
description: 在小程序运行时里用 wevu 写出边界清晰、更新可控、契约明确的页面、组件和 store。 本 skill 聚焦运行时行为和状态/事件契约。 应用本 skill 时,输出必须包含: runs…
category: data
runtime: no special runtime
---
# wevu-best-practices output preview
## PART A: Task fit
- Use case: 在小程序运行时里用 wevu 写出边界清晰、更新可控、契约明确的页面、组件和 store。 本 skill 聚焦运行时行为和状态/事件契约。 应用本 skill 时,输出必须包含: runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “用途 / 何时使用 / 不适用场景” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “在小程序运行时里用 wevu 写出边界清晰、更新可控、契约明确的页面、组件和 store。 本 skill 聚焦运行时行为和状态/事件契约。 应用本 skill 时,输出必须包含: runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “用途 / 何时使用 / 不适用场景” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files.
Start with a small task and check whether the result follows “用途 / 何时使用 / 不适用场景”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: wevu-best-practices
description: 在小程序运行时里用 wevu 写出边界清晰、更新可控、契约明确的页面、组件和 store。 本 skill 聚焦运行时行为和状态/事件契约。 应用本 skill 时,输出必须包含: runs…
category: data
source: weapp-vite/weapp-vite
---
# wevu-best-practices
## When to use
- wevu-best-practices 在小程序运行时里用 wevu 写出边界清晰、更新可控、契约明确的页面、组件和 store。 用户问 wevu 页面或组件应该怎么写。 用户问生命周期、hook 时序或 setup 约束。 用户问…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “用途 / 何时使用 / 不适用场景” and keep inference separate from source facts.
- read files, write/modify files; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "wevu-best-practices" {
input -> user goal + target files + boundaries + acceptance criteria
context -> 用途 / 何时使用 / 不适用场景
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} wevu-best-practices
用途
在小程序运行时里用 wevu 写出边界清晰、更新可控、契约明确的页面、组件和 store。
何时使用
- 用户问
wevu页面或组件应该怎么写。 - 用户问生命周期、hook 时序或 setup 约束。
- 用户问 props / emit / 双向绑定 / store。
- 用户问
setPageLayout、useNativeRouter或wevu/router。 - 用户问 AI 应如何保持 wevu 代码和模板约定一致。
- 用户反馈卡顿、掉帧、页面切换慢、白屏、内存告警,且问题主轴在
wevu运行时状态、渲染或副作用管理。
不适用场景
本 skill 聚焦运行时行为和状态/事件契约。
- 构建配置和分包:使用
weapp-vite-best-practices。 .vue模板和宏:使用weapp-vite-vue-sfc-best-practices。- 原生迁移:使用
native-to-weapp-vite-wevu-migration。
核心流程
- 运行时 API 从
wevu导入,页面和组件边界明确;选项式data若存在,保持函数形式。 - 生命周期和 hook 必须在同步
setup()中注册,不要在await之后注册。 - 响应式更新优先
ref/reactive/computed,避免大对象和不透明状态写入;模板状态要可序列化。 - 事件和双向绑定遵循小程序语义:
- 事件走
emit - 通用字段优先
bindModel/useBindModel - parser / formatter 语义明确
- 事件走
- layout 与 router 要分清:
- 运行时 layout 变化走
setPageLayout/usePageLayout - 区分原生 router helpers 与
wevu/router
- 运行时 layout 变化走
- 性能问题先分层:
setData路径:是否高频整对象回写、是否启用autoSetDataPick- render 路径:是否把重逻辑放进
onPageScroll - navigation 路径:
onHide/onUnload是否阻塞 - resource / memory:图片尺寸、缓存、监听与定时器是否清理
- store 以小 domain 为先,解构 state/getters 用
storeToRefs,避免巨大跨页 store。 - 写法同时对照项目根
AGENTS.md和本地dist/docs/wevu-authoring.md。
约束
- 不要在
await后注册 hooks。 - 不要直接解构 store 丢失响应性。
- 不要返回不可序列化原生实例到模板状态。
- 不要把浏览器 Vue 行为当成 wevu 默认行为。
- 不要在没有基线时同时修改性能、运行时和业务逻辑三类变量。
输出
应用本 skill 时,输出必须包含:
- 运行时风险摘要。
- 文件级改动建议。
- 相对 Vue Web runtime 的兼容说明。
- 最小验证命令。
完成标记
- API 导入来自
wevu。 - 页面 / 组件边界清晰。
- hook 注册时序正确。
- layout、router、store 选择有明确理由。
- 与项目
AGENTS.md约定一致。
参考资料
references/component-patterns.mdreferences/store-patterns.mdreferences/troubleshooting-checks.mdreferences/runtime-perf-matrix.mdreferences/tuning-recipes.md
Decide Fit First
Design Intent
How To Use It
Boundaries And Review