knowledge-sweep-cocos
Cocos Reuse Loop: Sweep, Ground, Decide, Contribute Back
Section titled “Cocos Reuse Loop: Sweep, Ground, Decide, Contribute Back”The kit’s most important rule. Find prior art before building; reusable work goes to cocos-stdlib and is consumed back. Detail: docs/knowledge-sweep-cocos.md.
bun ".claude/skills/t1k-cocos-base-knowledge-sweep/scripts/detect-cocos-project.cjs": exit 0 = applies.
When it runs
Section titled “When it runs”Before a plan, a new class/service/component, or a review finding; template glue included. Never copy one silently. Plan stage: docs/knowledge-sweep-cocos.md § “Plan-time check”.
The four steps
Section titled “The four steps”-
Sweep the corpus via
t1k-cocos-base-knowledge-sweep; skip only if the exact symbol is known (skills/t1k-cocos-base-knowledge-sweep/references/doc-search-contract.md). -
Ground in the graph: absent →
graph: unavailable, never dead-code. -
Grep to ground the hit, never skipped:
assets/packages/@playablelabs/,assets/scripts/, embedded framework folders. -
Record one verdict line per capability, then act on it:
reuse-verdict: REUSE|EXTEND|NEW|CONTRIBUTE|KEEP|unverified — <symbol or @playablelabs/package> — scope: <N> Cocos assembliesREUSEinstalls viaplayableSync, never copies source ·EXTEND/CONTRIBUTErunst1k-cocos-base-stdlib-contribute·NEW/KEEPname the game-specific part inreason:.
Not found: classify, default CONTRIBUTE
Section titled “Not found: classify, default CONTRIBUTE”A capability no step finds is reusable unless shown game-specific: name the game-specific part (level schema, tuning, rule, content). None nameable → CONTRIBUTE, built in cocos-stdlib as @playablelabs/<name> in the same task and consumed via playableSync.
Never a reason to keep it local: “only this game needs it”, “one caller”, “faster to copy”, “stdlib not synced here”. Unsynced means search, not skip: the corpus (assembly_prefix: "packages"), then resolve-stdlib-package.cjs ($COCOS_STDLIB_DIR or a cached gh clone). A missing CPM token blocks the install, never the verdict.
Ask at task end, once, batched: an uncontributed CONTRIBUTE, or a doubtful KEEP/NEW → one AskUserQuestion (contribute now · later as tracked follow-up · keep local with reason). Sub-agents report to their parent, which asks. stdlibContribute.mode=auto skips the ask and the contribution runs. Protocol: docs § “Ask at task end”.
Provenance
Section titled “Provenance”Sources: installed/corpus/graph/none. A negative states its scope, never a bare “greenfield”. MCP absent → unverified, never CONTRIBUTE.