t1k:playablelabs:base:cpm-sweep
| Field | Value |
|---|---|
| Module | base |
| Version | 2.29.2 |
| Effort | low |
| Tools | — |
Keywords: check cpm before building, cpm package sweep, existing playablelabs package, playablelabs cpm sweep, playablelabs reuse verdict, web playable prior art
How to invoke
Section titled “How to invoke”/t1k:playablelabs:base:cpm-sweep<capability phrase> [--engine web|none|cocos]CPM sweep: does the studio already publish this?
Section titled “CPM sweep: does the studio already publish this?”Run BEFORE writing a lib, helper or system for a playable (web three.js, none, or Cocos). The answer is one
reuse-verdict: line per need. It exists because a false “greenfield” is the costliest planning error, and the one
place installable code lives (cocos-stdlib on CPM) is invisible to a broad corpus query.
Facts (auth, CPM-only consumption, versioning, ADD vs UPDATE, which hits are usable on web):
references/cpm-facts.md. Cocos games: the Cocos side of this loop is
t1k-cocos-base-knowledge-sweep (+ its doc-search-contract.md); when theonekit-cocos is installed, use it for
Cocos-scoped corpus queries and treat this skill as the web/none layer on top. Neutral loop and provenance rules:
core t1k-knowledge-retrieval.
Two sources, both, and say which produced each verdict
Section titled “Two sources, both, and say which produced each verdict”- Knowledge corpus (
mcp__knowledge-retrieval__doc_search): finds that a capability exists. - CPM (https://cpm.playablelabs.ai/, or
bun info @playablelabs/<name> version --registry=https://cpm.playablelabs.ai): confirms the exact package name and published version. Install-side auth:cpm-facts.mdsection “Auth”.
-
Name the need as a capability, not a local class name (“seeded random weighted draw”, not
LootRoller). -
Corpus, three calls per need (verified live 2026-10-23 on “seeded random generator”):
- broad:
doc_search({ query, limit: 25 }). Unscoped it surfaced third-party npm libs (rand-seed,@dgreenheck/three-pinata, repoThe1Studio/playable-ext-libs) and game projects, and no stdlib hit in the top 5. - library pass:
doc_search({ query, limit: 10, assembly_prefix: "packages" })returned cocos-stdlib’sSmallLcgRandom,RandomSource,DeterministicRandom,Mulberry32Random. This is the only source ofREUSE. (assembly_prefix: "catalog"holds mechanic cards: a pattern to copy, never an install.) - the prefix is an exact assembly name, never a partial. A broad query that shows no stdlib hit proves nothing.
- broad:
-
Resolve the hit to a package. A
packages#...hit names no package. Find the declaring file in a cocos-stdlib checkout (rg -n "class <Symbol>|interface <Symbol>" packages/*/src, checkout at$COCOS_STDLIB_DIRor a siblingcocos-stdlibclone) and read thatpackage.json; or look the symbol up incapability-index.json(packages[].name/version/layer/wiring.import). Then confirm on CPM withbun info. Whentheonekit-cocosis installed itsresolve-stdlib-package.cjsdoes this resolution. -
Usable here? Web/
none: applycpm-facts.mdsection “Which stdlib hits are usable on web”.cc-*is never usable; acore-*hit needs thecc/threegrep on its reachablesrc. Before a web/noneinstall runbun scripts/web-install-check.cjs @playablelabs/<name> --project <game dir> --json(read-only: host, scope line, auth presence,engineCompat, install command, import form; exit 3 forcc-*, 4 no auth). Never useinstall-package.cjsorplayableSyncthere; bun installs peers itself. -
Ground with grep in the game repo (installed
node_modules/@playablelabs/,package.json,src/, and for Cocosassets/packages/@playablelabs/). Corpus tells you what exists; grep tells you what is on disk. -
Decide and record one line per need:
reuse-verdict: REUSE|EXTEND|NEW|CONTRIBUTE|KEEP|unverified — <package@version or symbol> — scope: <what you swept> — via: <mcp|cpm|both|index>KEEPalso carriesreason:(>= 20 chars) andindex:; a waiver isreuse-verdict: waived <reason, >= 10 chars>. The words and fields are core’sdata/reuse-gate.jsonverdictsblock; full table incpm-facts.md“Verdict vocabulary”.Verdict Next REUSEinstall the published version ( cpm-facts.md“Consumption”); never copy sourceEXTENDa close stdlib package should absorb it: hand to t1k-playablelabs-base-stdlib-contribute(UPDATE)CONTRIBUTEnothing installable, and the code can be engine-neutral: t1k-playablelabs-base-stdlib-contribute(this kit’s implementation of core’s CONTRIBUTE destination, seecpm-facts.md)NEWnothing covers it and it is not a stdlib candidate: new game code; scope:is mandatoryKEEPstays in the game; reason:(>= 20 chars: needsthree/cc, game-specific, below package granularity) andindex:are mandatoryunverifieda source was unreachable; never CONTRIBUTE, never “greenfield”
Negative results state their scope
Section titled “Negative results state their scope”“No package” is a claim about your search. Write it as zero hits across <queries run, assembly_prefix values, CPM names tried>, and scope: on the verdict line. If the MCP was absent after a reconnect, or CPM returned 401/502,
the verdict is unverified and the line says which source failed.
Executed by
Section titled “Executed by”Running scripts/web-install-check.cjs and reading its report is mechanical, so a cheap-tier agent may do it. Choosing the verdict word, and whether a core-* hit is really engine-free, stays with the main session or a native agent. Routing SSOT: rules/orchestration-rules.md § “Task-Type → Agent Routing”.
Hard rules
Section titled “Hard rules”limit: 25on the broad call, or the crowded results hide the real hit; drill-down calls withassembly_prefixneed no such limit.- The corpus holds Unity/.NET members that outrank everything on unscoped queries; add
engine: "cocos"or anassembly_prefixwhen the question is about stdlib. Query technique:skills/t1k-knowledge-retrieval/references/query-technique.md(core). - Existence is not reuse: a stdlib package that exists may be older than the game’s copy. Diverged-ahead copy means
EXTEND, notREUSE(cpm-facts.md“ADD or UPDATE”). - Do not hand-write a package name from memory. The registry and the index are the source of names and versions.