- After dependencies are installed, prefer reading local package docs under
node_modules/weapp-vite/dist/docs/first. - Start with
node_modules/weapp-vite/dist/docs/index.md, then readREADME.mdandmcp.mdas needed. - Prefer local package docs over stale model memory or old web pages when command behavior is unclear.
- This project supports both
weapp-viteandwvCLI commands. - Treat
weapp-vite devandwv devas equivalent forms. - Prefer project scripts such as
pnpm dev,pnpm build,pnpm open, andpnpm gbefore ad-hoc shell commands. - Use
weapp-vite prepareorwv preparewhen managed support files under.weapp-vite/need to be refreshed. - Prefer
weapp-vite screenshotorwv screenshotfor mini-program screenshot acceptance. - Prefer
weapp-vite ide logs --openorwv ide logs --openfor DevTools terminal log bridging. - Do not default to generic browser screenshot tools when the target is the mini-program runtime in WeChat DevTools.
- Keep
vite.config.tsas the source of truth forweappconfig, output behavior, and IDE/MCP automation. - Confirm
weapp.srcRoot, routes, subpackages, and auto-import strategy before broad refactors. - Prefer minimal scoped verification: targeted
pnpm build, targeted tests, then broader checks only when required. - Task completion gate: before handing off any coding task, run
pnpm check(equivalent topnpm lint,pnpm typecheck,pnpm stylelint) and report results. - If editing package source in a monorepo dependency, rebuild the touched package before validating downstream apps to avoid stale
dist. - Keep CLI ownership explicit: native
weapp-vitecommands first, IDE passthrough second.
- Before using screenshot, preview, upload, automator, or
--open, ensure WeChat DevTools is logged in and the service port is enabled. - Prefer writing screenshots to workspace paths such as
.tmp/acceptance.png.
- Recommend installing shared skills with
npx skills add sonofmagic/skills. - In Codex/Claude environments, prefer these skills first when available:
$weapp-vite-best-practicesfor config, build, subpackage, route, and CLI orchestration work.$weapp-vite-vue-sfc-best-practicesfor.vueSFC macros, JSON blocks, and template compatibility.$weapp-ide-cli-best-practicesfor DevTools automation, screenshot, preview, upload, and config commands.$docs-and-website-syncwhen documentation or AI guidance must be refreshed together with code changes.$wevu-best-practicesforwevuruntime lifecycle, state, store, and event contracts.
- Import runtime APIs from
wevuin business code. - Register lifecycle hooks synchronously in
setup()and avoid hook registration afterawait. - Prefer
ref,reactive,computed, and explicit event contracts over large opaque state writes. - Use
storeToRefswhen destructuring store state/getters. - Treat mini-program runtime constraints as primary; do not assume Vue web-only behavior.