TRAE Wrote Every Line of This WeChat Mini Game Collection, Then WeChat Forced a Full Rewrite
Building a game inside WeChat's Mini Program category fails at release, because WeChat only allows games under the Mini Game category, and the two runtimes are incompatible. The refactor cost here, 141 files and 33k deleted lines, is the price of that mistake, and TRAE absorbed it entirely.
TRAE, an AI coding assistant, wrote every line of a WeChat mini game collection starting from an empty directory. The first generation used Taro + React + TypeScript, chosen by TRAE to validate gameplay quickly. Three games came out of it: a QR-code maze whose walls form a real scannable QR code, a gravity balance-ball game, and a vertical shooter with squad mechanics, arithmetic gates, elite monsters, and boss fights. PBitW's role stayed on the product side: describing requirements, setting acceptance criteria, playtesting, and sending screenshots.
Publishing hit a platform wall. WeChat does not allow games under the Mini Program category, so the account had to switch to the Mini Game category with a new AppID. Taro-generated Mini Program code does not run in the Mini Game runtime, which has no pages or components and draws all UI on a Canvas. TRAE evaluated the options and recommended a native Mini Game rewrite. The refactor touched 141 files with +24,332/−33,181 lines, preserving gameplay while rebuilding the architecture around game.js and Canvas rendering.
Two pieces of TRAE output stand out. One is a hand-written QR Model 2 encoder, byte-mode UTF-8, error correction level L, versions 1–8, validated by feeding its matrices to jsQR and checking the decoded string matches the input. The other is a deterministic level factory: every level derives from a mulberry32 seed, so the same level number always produces the same maze, shooter waves, and balance-ball layout. A Node smoke test injects a wx stub and runs level factory, QR derivation, and shooting engine checks without WeChat. The same workload, done by hand with research and debugging, was estimated at over a month; TRAE finished it in a few days. The takeaway: the ceiling on AI coding is the clarity of the requirements and the strength of the acceptance tests.
Cross-file structural changes are where TRAE earned its keep: translating a 226-line TypeScript timeline to CommonJS across 20+ files in one session is the kind of work that usually costs a human days.
The deterministic level factory is what made the whole workflow safe. Because every level is a pure function of its level number and the logic layer runs under a wx stub in Node, TRAE's output had a machine-checkable definition of done, and the human only had to verify feel.
The rewrite was driven by a WeChat category rule, not by performance or code quality. That shows a platform constraint can wipe out an entire stack choice regardless of how well the code was written.