Skip to content

t1k:playablelabs:base:stdlib-adopt-web

FieldValue
Modulebase
Version2.29.2
Effortlow
Tools—

Keywords: adopt playablelabs package web, adopt stdlib web, install cpm package web, none host reuse, three playable stdlib, web playable reuse

/t1k:playablelabs:base:stdlib-adopt-web
<capability phrase> [--project <dir>]

Adopt a stdlib package in a web or none project

Section titled “Adopt a stdlib package in a web or none project”

Run BEFORE writing a gameplay primitive (random, timer, tween, grid, FSM, …) in a project whose host is web (three, Pixi, Phaser) or none. Read-only: it ends in one verdict line per need and, for REUSE, the install command for the user’s session to run. It ships no hook (deferred behind core #5417). Cocos projects use t1k-cocos-playable-stdlib-adopt.

Facts and the verdict vocabulary: t1k-playablelabs-base-cpm-sweep -> references/cpm-facts.md. Never copy package source into the game: consumption is CPM-only (playablelabs-decouple-game-code.md).

  1. Detect the host. Run bun .claude/skills/t1k-playablelabs-base-cpm-sweep/scripts/web-install-check.cjs <any-package> --project <dir> --json. Exit 2 with “Cocos project” means STOP and hand over to the Cocos adopt skill. Otherwise read host.id (web or none).

  2. Sweep. mcp__knowledge-retrieval__doc_search with 2-3 content words and assembly_prefix: "packages"; then filter the committed capability-index.json rows to engineCompat containing host.id. A row with engineCompat: null is unknown: say so, and apply the layer rules in cpm-facts.md.

  3. Ground each hit. rg -n "from ['\"](cc|three)" <package>/src on the package source: a core-*, feature-* or mechanic-* hit with no cc/three import is usable. A cc-* hit is prior art for design only, never an install.

  4. Preflight each candidate. bun .claude/skills/t1k-playablelabs-base-cpm-sweep/scripts/web-install-check.cjs @playablelabs/<name> --project <dir> --json.

    ExitMeaningNext
    0installableprint install.bun and importForm.line
    2usage error or Cocos projectfix the call, or stop (step 1)
    3cc-* or engineCompat excludes the hostprior art only; verdict EXTEND, NEW or KEEP
    4no registry scope or authprint the fix from verdict.reasons; verdict unverified
  5. Print one verdict line per need, in core’s vocabulary (data/reuse-gate.json): reuse-verdict: REUSE|EXTEND|NEW|KEEP|unverified — <package@version or symbol> — scope: <what you swept> — via: <mcp|cpm|both|index>. Core’s gate writes reuse-verdicts.jsonl only for Cocos projects, so here the verdict lines go in the PR body.

  6. Never install silently. The user’s session runs bun add @playablelabs/<name>; bun installs peers itself.

Steps 1 and 4 are mechanical (run the script, read its exit code), so a cheap-tier agent may do them. Choosing the verdict word and judging step 3 stays with the main session or a native agent. Routing SSOT: rules/orchestration-rules.md § “Task-Type → Agent Routing”.

  • A broad corpus query that shows no stdlib hit proves nothing; use assembly_prefix: "packages".
  • No capability index on disk: the script reports engineCompat: unknown; do not guess it, say unverified.