Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 3.05 KB

File metadata and controls

49 lines (37 loc) · 3.05 KB

AGENTS Guidelines

Local Docs First

  • 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 read README.md and mcp.md as needed.
  • Prefer local package docs over stale model memory or old web pages when command behavior is unclear.

CLI Entry

  • This project supports both weapp-vite and wv CLI commands.
  • Treat weapp-vite dev and wv dev as equivalent forms.
  • Prefer project scripts such as pnpm dev, pnpm build, pnpm open, and pnpm g before ad-hoc shell commands.
  • Use weapp-vite prepare or wv prepare when managed support files under .weapp-vite/ need to be refreshed.
  • Prefer weapp-vite screenshot or wv screenshot for mini-program screenshot acceptance.
  • Prefer weapp-vite ide logs --open or wv ide logs --open for DevTools terminal log bridging.
  • Do not default to generic browser screenshot tools when the target is the mini-program runtime in WeChat DevTools.

Weapp-vite Workflow

  • Keep vite.config.ts as the source of truth for weapp config, 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 to pnpm 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-vite commands first, IDE passthrough second.

WeChat DevTools

  • 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.

AI Skills

  • Recommend installing shared skills with npx skills add sonofmagic/skills.
  • In Codex/Claude environments, prefer these skills first when available:
    • $weapp-vite-best-practices for config, build, subpackage, route, and CLI orchestration work.
    • $weapp-vite-vue-sfc-best-practices for .vue SFC macros, JSON blocks, and template compatibility.
    • $weapp-ide-cli-best-practices for DevTools automation, screenshot, preview, upload, and config commands.
    • $docs-and-website-sync when documentation or AI guidance must be refreshed together with code changes.
    • $wevu-best-practices for wevu runtime lifecycle, state, store, and event contracts.

Wevu Authoring

  • Import runtime APIs from wevu in business code.
  • Register lifecycle hooks synchronously in setup() and avoid hook registration after await.
  • Prefer ref, reactive, computed, and explicit event contracts over large opaque state writes.
  • Use storeToRefs when destructuring store state/getters.
  • Treat mini-program runtime constraints as primary; do not assume Vue web-only behavior.