Skip to content

t1k:unity:base:lib-consume

FieldValue
Modulebase
Version5.116.6
Effortmedium
ToolsBash, Read

Keywords: adopt finding, adopt library type, consume library type, lib consume, library equivalent, replace local type with package, swap local copy for library

/t1k:unity:base:lib-consume

Unity Library Consume: use the library type instead of the game’s copy

Section titled “Unity Library Consume: use the library type instead of the game’s copy”

Closes the loop of t1k-unity-base-lib-candidates: an adopt finding (the library already ships it) or a merged contribute PR (the library now ships it) ends with the game depending on the package and deleting its copy. Run by the game’s session, never by a steward. The mechanical half is scripts/consume.cjs.

Terminal window
CLI=.claude/skills/t1k-unity-base-lib-consume/scripts/consume.cjs
# 1. plan (DEFAULT: writes nothing)
bun $CLI --project <root> --candidate <report.json> --id <candidate id> \
--version <published> --library-namespace <ns> --library-asmdef <asmdef>
# 2. only when "blockers" is empty
bun $CLI ...same flags... --apply

--candidate takes lib-candidates report --format json (pick a row with --id; adopt.libraryPackage and adopt.localPath are read from it) or a bare JSON row. Every field also has a flag: --local-path --symbol --package --local-namespace --registry-url --scope. One JSON document on stdout. Exit 0 plan/applied, 2 usage, 3 refused (apply with blockers; nothing written), 1 internal.

BlockerWhy
serialized-referencesa scene/prefab/asset holds m_Script: {guid: <local script guid>}; the library copy has a new guid and would null it
unscannable-asseta binary-serialized or oversized asset cannot prove absence of a reference
no-meta-guid, multi-type-file, symbol-not-found, path-escapethe plan cannot prove the removal is safe
version-not-resolvable (apply)bun info <pkg>@<version> on the registry must succeed first; publish is owner-triggered

MonoBehaviour/ScriptableObject types with serialized references are out of v1 unless the lifted script kept the old .meta guid. Do not hand-edit around a blocker; report it.

Edits Packages/manifest.json (dependency + scoped registry), rewrites namespace/using in the other .cs files, adds the library asmdef to the referencing asmdefs, then git rms the local file and .meta, then runs the existing t1k-unity-architecture-dep-reconciler in its DRY-RUN mode over the touched assemblies (reported under reconcile; unavailable when the architecture module is absent). It never applies the reconciler.

Compile and EditMode tests through the unity batch gate, open the game PR, then re-run lib-candidates scan and ack --decision consumed. Registry auth: t1k-unity-base-upm-auth. Details and the guid-scan rules: references/consume-contract.md.

Runs inline in the main session or an inline sub-agent Bash call: a deterministic script that prints one JSON document. It spawns nothing and needs no Unity editor.

  • Do not pass --apply before reading a dry-run with an empty blockers.
  • Do not run it in a worktree you do not own, or on a game with uncommitted changes you want to keep.
  • Do not guess --version: use the version bun info resolves.