Skip to content

t1k:playablelabs:base:cpm-sweep

FieldValue
Modulebase
Version2.29.2
Effortlow
Tools—

Keywords: check cpm before building, cpm package sweep, existing playablelabs package, playablelabs cpm sweep, playablelabs reuse verdict, web playable prior art

/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”
  1. Knowledge corpus (mcp__knowledge-retrieval__doc_search): finds that a capability exists.
  2. 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.md section “Auth”.
  1. Name the need as a capability, not a local class name (“seeded random weighted draw”, not LootRoller).

  2. 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, repo The1Studio/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’s SmallLcgRandom, RandomSource, DeterministicRandom, Mulberry32Random. This is the only source of REUSE. (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.
  3. 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_DIR or a sibling cocos-stdlib clone) and read that package.json; or look the symbol up in capability-index.json (packages[].name/version/layer/wiring.import). Then confirm on CPM with bun info. When theonekit-cocos is installed its resolve-stdlib-package.cjs does this resolution.

  4. Usable here? Web/none: apply cpm-facts.md section “Which stdlib hits are usable on web”. cc-* is never usable; a core-* hit needs the cc/three grep on its reachable src. Before a web/none install run bun 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 for cc-*, 4 no auth). Never use install-package.cjs or playableSync there; bun installs peers itself.

  5. Ground with grep in the game repo (installed node_modules/@playablelabs/, package.json, src/, and for Cocos assets/packages/@playablelabs/). Corpus tells you what exists; grep tells you what is on disk.

  6. 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>

    KEEP also carries reason: (>= 20 chars) and index:; a waiver is reuse-verdict: waived <reason, >= 10 chars>. The words and fields are core’s data/reuse-gate.json verdicts block; full table in cpm-facts.md “Verdict vocabulary”.

    VerdictNext
    REUSEinstall the published version (cpm-facts.md “Consumption”); never copy source
    EXTENDa 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, see cpm-facts.md)
    NEWnothing covers it and it is not a stdlib candidate: new game code; scope: is mandatory
    KEEPstays in the game; reason: (>= 20 chars: needs three/cc, game-specific, below package granularity) and index: are mandatory
    unverifieda source was unreachable; never CONTRIBUTE, never “greenfield”

“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.

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”.

  • limit: 25 on the broad call, or the crowded results hide the real hit; drill-down calls with assembly_prefix need no such limit.
  • The corpus holds Unity/.NET members that outrank everything on unscoped queries; add engine: "cocos" or an assembly_prefix when 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, not REUSE (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.