t1k:unity:base:lib-consume
| Field | Value |
|---|---|
| Module | base |
| Version | 5.116.6 |
| Effort | medium |
| Tools | Bash, Read |
Keywords: adopt finding, adopt library type, consume library type, lib consume, library equivalent, replace local type with package, swap local copy for library
How to invoke
Section titled “How to invoke”/t1k:unity:base:lib-consumeUnity 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.
Command
Section titled “Command”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 emptybun $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.
What it refuses (v1)
Section titled “What it refuses (v1)”| Blocker | Why |
|---|---|
serialized-references | a scene/prefab/asset holds m_Script: {guid: <local script guid>}; the library copy has a new guid and would null it |
unscannable-asset | a binary-serialized or oversized asset cannot prove absence of a reference |
no-meta-guid, multi-type-file, symbol-not-found, path-escape | the 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.
What --apply does
Section titled “What --apply does”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.
Next (the caller’s, not the script’s)
Section titled “Next (the caller’s, not the script’s)”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.
Executed by
Section titled “Executed by”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
Section titled “Do not”- Do not pass
--applybefore reading a dry-run with an emptyblockers. - 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 versionbun inforesolves.