t1k:cocos:playable:extract
| Field | Value |
|---|---|
| Module | playable |
| Version | 0.5.6 |
| Effort | high |
| Tools | — |
Keywords: analyze, bundle, competitor, decompile, extract, playable, playable ad, reverse engineer
How to invoke
Section titled “How to invoke”/t1k:cocos:playable:extract<url>Cocos Playable Extract — Competitor Playable Reverse-Engineer
Section titled “Cocos Playable Extract — Competitor Playable Reverse-Engineer”Given a competitor playable-ad HTML bundle URL, produce 3 commit-ready English docs and a gitignored raw/ artifact tree.
/t1k:cocos:playable:extract <https-url-to-playable.html>Pipeline (5 runtime phases)
Section titled “Pipeline (5 runtime phases)”- Fetch —
scripts/fetch-bundle.cjs <url> <outDir>/raw/— crawls same-origin HTML/JS/img/audio/json, writesraw/manifest.json(sourceUrl, timestamp, fileList, sha256Map, cacheKey). Hard cap: 10 MB. - Unpack —
scripts/unpack-bundle.cjs <outDir>/raw/— extracts inline<script>tags, decodes base64, beautifies JS viajs-beautify. - Detect — engine fingerprint (cocos creator 3.x / 2.x / pixi / playcanvas / custom) using regex catalog in
references/engine-fingerprints.md. Output: detected engine + version + confidence + entry-point JS file. - Analyze — spawn
t1k-cocos-playable-extractorsubagent (background, fork context). Subagent reads beautified JS + assets, infers gameplay loop, code architecture, monetization hooks (catalog:references/monetization-hooks.md). - Generate — subagent writes 3 docs from templates in
references/templates/:gameplay.md— genre, core loop, win/lose, CTAs, session length, monetizationcode-structure.md— engine + version, bundle breakdown, entry point, modules, event flow, obfuscation levelcocos-implementation.md— Cocos rebuild recipe; MUST cite ≥5 distinctt1k-cocos-playable-*skills with concrete invocation arguments
Skill Body Steps (when invoked)
Section titled “Skill Body Steps (when invoked)”- Validate
<url>is http(s); reject otherwise - Compute
slug = sha256(url).slice(0,8) + '-' + guessGameNameFromUrl(url)(rules:references/slug-rules.md) - Resolve
outDir = plans/research/playable-{slug}/ - Cache check: if
outDir/raw/manifest.jsonmatches input URL hash → skip to step 7 - Run
scripts/fetch-bundle.cjs→ smoke first file, surface result, gate via user confirm before full crawl (perrules/preview-first-batch.md) - Run
scripts/unpack-bundle.cjs - Spawn
t1k-cocos-playable-extractorsubagent in background with arguments:rawDir, module-inventory (frommetadata.json.installedModules+t1k-activation-*.json), 3 doc output paths - Skill validates output: each doc exists,
cocos-implementation.mdcites ≥5 distinctt1k-cocos-playable-*skills, no inline binary, no PII (URLs/tokens/query params stripped viascripts/lib/sanitize.cjs) - Append
outDir/raw/to.gitignoreunder marker block# t1k:cocos:playable:extract BEGIN/END(append-only) - Commit
outDir/raw/manifest.jsononly — full raw assets stay gitignored (Q2=B resolution) - Final prompt: “Run
/t1k:planagainstcocos-implementation.md?”
Output Layout
Section titled “Output Layout”plans/research/playable-{slug}/├── gameplay.md # committed├── code-structure.md # committed├── cocos-implementation.md # committed└── raw/ ├── manifest.json # committed (Q2=B) ├── index.html # gitignored ├── scripts/*.js # gitignored ├── scripts/*.beautified.js # gitignored └── assets/ # gitignoredConstraints
Section titled “Constraints”- Static analysis only — no headless execution, no source-map de-obfuscation
- 10 MB hard cap on total bundle size; refuses past cap with explicit message (Q3=A resolution)
- Single URL per invocation — no batch mode
- Cocos rebuild recipe always emitted, regardless of detected engine (kit’s purpose)
- Confidence tagging mandatory — every doc footer states confidence (high/med/low) with reason; subagent must fall back to “behavioral spec” mode rather than fabricate identifiers when obfuscation defeats analysis
Common Mistakes
Section titled “Common Mistakes”- Hardcoding ad-network CDN domains in scripts — keep configurable via input URL only
- Re-fetching when cache is valid — always check
manifest.jsonfirst - Committing
raw/assets — onlymanifest.jsonis committed; full tree is gitignored - Citing fewer than 5 Cocos skills in
cocos-implementation.md— validator must reject
Gotchas
Section titled “Gotchas”- Mintegral CDN 401/403 — some assets walled;
fetch-bundle.cjslogs gap to manifest and continues with available files. Subagent must flag “partial bundle — analysis may miss assets” incode-structure.md. - Obfuscated identifiers —
t/e/nminified variable names defeat structure analysis. Subagent uses “describe-by-behavior” mode: notesobfuscation: heavy — identifiers unrecoverableinstead of fabricating names. - Cocos runtime is ~2 MB of boilerplate — subagent must skip engine code (regex-detected via
references/engine-fingerprints.md) to preserve token budget for game-specific code. - URL sanitizer is SSOT — never write a raw URL to manifest, docs, or chat; route every URL through
scripts/lib/sanitize.cjsfirst to strip tracking params and PII.
Related
Section titled “Related”t1k-cocos-playable-build-size— bundle-size targets the recipe referencest1k-cocos-playable-fsm,t1k-cocos-playable-signalbus,t1k-cocos-playable-lifecycle,t1k-cocos-playable-object-pool,t1k-cocos-playable-parameter— core skills the rebuild recipe citesrules/preview-first-batch.md— smoke-first gate enforced in Step 5rules/code-conventions-cocos.md— file scaffold the recipe matches