Pixi WeChat Mini-Game Adapter
Use this skill when a PixiJS v8 + TypeScript + Vite project needs a standard WeChat mini-game solution instead of ad hoc runtime shims.
This skill is the canonical source of truth for:
- the WeChat runtime contract
- the starter/template assets
- the install flow
- the validation matrix
- the maintenance loop for new failure modes
Compatibility Envelope
Strong guarantee applies only to:
PixiJS v8TypeScriptVite
Other stacks may still reuse the references, but they are migration work, not direct-template installs. Use references/migration-guide.md for those cases.
Modes
The standard solution exposes exactly two install modes:
overlay: add WeChat support to an existing PixiJS Web reposkeleton: create a fresh Web + WeChat starter repo
It also exposes two text-module modes:
none: defaultfixed-copy-glyph: optional scaffold for packaged fixed-copy text workflows
Canonical Contract
Every install from this skill must preserve these rules:
game.jsbinds exactly one screen canvas before the runtime bundle loads.- The screen canvas is published to standard global aliases and an internal screen-canvas key.
- All later
wx.createCanvas()calls are offscreen-only. prepareWeChatRuntime()only prepares the environment and DOM shim; it never chooses or recreates the display canvas.WeChatPlatformonly consumes the prebound screen canvas.- DevTools native
documentis reused when present. - Synthetic DOM uses an internal child store; it never assumes native
childrenis an array. - WeChat-specific logic stays in
game.js,platform/, and build tooling.
Install Flow
- Read
references/install-modes.mdand chooseoverlayorskeleton. - Run the installer:
python3 scripts/install_starter.py --mode overlay --text-module none --target-repo /path/to/repopython3 scripts/install_starter.py --mode skeleton --text-module none --target-repo /path/to/repo
- If you need packaged fixed-copy text scaffolding, rerun with
--text-module fixed-copy-glyph. - Adapt only the seams listed in
references/install-modes.md. - Run the commands in
references/validation-matrix.md. - Execute the DevTools and device checks from
references/smoke-checklist.md. - If the game boots but stays black, load $pixi-wechat-black-screen.
- After bootstrap lands, use $pixi-web-wechat-dual-target for ongoing work.
Required Deliverables
An installation is only complete when the target repo has:
- a stable Web target and WeChat debug/release targets
make web,make wechat,make wechat-debug,make audit,make test,make lint, andmake typecheck- a release audit step
- a smoke checklist for DevTools and device verification
- a clear record of any remaining
partial,pending, orblockedvalidation
Maintenance Rule
Fix canonical assets first, then sync the consuming repo. Do not treat a business repo as the starter-template source of truth.
Resource Map
references/architecture.md: runtime layers, ownership rules, and adapter boundariesreferences/install-modes.md: overlay vs skeleton expectations and customization seamsreferences/validation-matrix.md: required commands, evidence language, and acceptance gatesreferences/smoke-checklist.md: DevTools and on-device smoke flowsreferences/troubleshooting.md: black-screen, canvas, DOM, and text-related failure modesreferences/maintenance.md: source-of-truth and update workflowreferences/migration-guide.md: guidance for non-Vite or non-Pixi-standard reposscripts/install_starter.py: installs the canonical starter into a target reposcripts/sync_starter_manifest.py: regenerates the canonical asset manifestscripts/validate_solution.py: validates the skill assets and install flow