Cocos playbuild integration
Skill meyverick/agy-skills/skills/cocos-playbuild-integration
A collection of elite, modular, and validated AI agent skills and system rules for Google Antigravity.
npx -y skills add meyverick/agy-skills --skill cocos-playbuild-integrationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Configures Cocos Creator macro-build exports. Use when bundling Cocos mechanics into single-file playable ads.
SKILL.md
2.2 KB, as published. Nobody here has run it
Cocos Playbuild Integration
This skill standardizes the export of a Cocos Creator 3.x project into a single-file, highly compressed HTML payload for playable ads, using specific macro overrides and build templates.
When to Use
- Use when exporting a playable ad from Cocos Creator.
- Use when hooking Cocos input events to external MRAID wrappers.
- NOT for standard PC or mobile app exports.
Core Process
Phase 1: Engine Stripping (Macros)
- In
Project Settings -> Macro Config, explicitly disableENABLE_WEBGL_ANTIALIAS,ENABLE_WEBGL_DEPTH_TEXTURE, andENABLE_PHYSICS_3Dif the ad is 2D. - Enable
CLEANUP_IMAGE_CACHE.
Phase 2: Single-File Bundling
- Utilize a custom build template (
build-templates/web-mobile) that explicitly base64 encodes the generatedcocos-jsengine and asset bundle. - Ensure the build pipeline injects all generated code into a single
index.html.
Phase 3: The PlayBuildLibrary Interface
- Do not write raw
mraidcalls directly inside Cocos TypeScript components. - Write a slim
PlayBuildLibrary.tsinterface that emits standard events (GAME_START,GAME_END,CTA_CLICKED). The external HTML wrapper listens to these events to trigger network-specific SDKs.
Common Rationalizations
| Rationalization | Reality |
|---|---|
| "I'll just manually copy-paste the JS into the HTML after building." | Manual steps fail and are not reproducible. You must use Cocos build-templates to automate the single-file injection. |
"I'll call mraid.open() inside the Cocos button click handler." | This hardcodes the game to one network. You must emit a CTA_CLICKED event to the wrapper instead. |
Red Flags
- Missing custom
build-templatesforcing manual HTML post-processing. - Heavy 3D physics macros left enabled for simple 2D games.
Verification
Before finalizing the Cocos integration:
- The export pipeline automatically generates a standalone
index.htmlfile. - The
PlayBuildLibraryacts as the sole bridge between Cocos TS and the outer DOM. - Engine macros are aggressively stripped for performance.