t1k:unity:base:lib-packaging
| Field | Value |
|---|---|
| Module | base |
| Version | 5.116.6 |
| Effort | medium |
| Tools | Bash, Edit, Glob, Grep, Read, Write |
Keywords: asmdef, com.theone, contribute to library, extraction plan, lib adapter, library packaging, new unity library, scaffold upm repo, TheOne library, unity package.json, unity packaging, upm library
How to invoke
Section titled “How to invoke”/t1k:unity:base:lib-packagingUnity UPM Library Packaging — lib adapter
Section titled “Unity UPM Library Packaging — lib adapter”The Unity half of the adapter contract
(theonekit-core → t1k-lib-contribute/references/adapter-contract.md): core owns
the flow, this skill owns the Unity mechanics. Every action here is planned or
emitted, never executed upstream — a diff is emitted, a repo create is planned.
No step of this skill runs in the consumer’s tree.
Scope: UPM package mechanics only. Flow control (hard gates, registry rows,
approval order) lives in t1k-lib-contribute / t1k-lib-create — cite them,
never restate them.
contribute
Section titled “contribute”When it applies: the knowledge sweep returned CONTRIBUTE for generic game code, so the code
lands in the lib, not the game (docs/library-first-contribute-back.md).
Registry name: t1k-unity-base-lib-packaging#contribute.
| Input (from the extraction plan) | Output |
|---|---|
| files + destination paths, dependency list, renames | a git diff against a temp shallow clone of the target UPM library repo |
The clone lives in the scratchpad — never the consumer tree.
-
Clone —
git clone --depth 1 <library-url> "$SCRATCHPAD/lib-clone/<pkg>". Work only inside that clone. -
Place source — runtime code under
Runtime/, editor-only code underEditor/, tests underTests/. Apply the plan’s renames as you place; a renamed.cstakes its.metawith it (Unity pairs them by GUID). -
.asmdef— add references for the plan’s new dependencies, dottedTheOne.<Area>form. Check the target name for an asmdef collision first (t1k-lib-create/references/naming.md— collisions overwrite corpus rows). -
package.json— add the same deps underdependencies(com.theone.<area>ids), bump the version per the library’s semver practice. -
Emit the record — one line per contributed symbol, at column 0, exactly:
reuse-search: CONTRIBUTE | symbol: <Type> | scope: <scope> | swept: <YYYY-MM-DD>(<Type>= the type/primitive placed;<scope>= what was swept, e.g.12 assemblies; grammar:docs/reuse-search-record.md§CONTRIBUTE). This is the line the kit’srsiSignalsentry (unity-reuse-search-contributein.claude/t1k-config-unity.json) matches to raise a studio-library candidate — do not reword or wrap it, and never put a|insidesymbol:. Thengit -C "$SCRATCHPAD/lib-clone/<pkg>" diff→ hand the patch text to the spawner. NEVERgit push, never commit to the library repo from here. -
Smoke — plan carries >1 symbol → run N=1 first (one symbol through steps 2–5,
reuse-search:line included), surface that diff, scale only on approval. Preview-first, never silently scale. -
Hand off the consume side — once the library PR is merged and the version resolves on the registry, the game swaps its copy for the package with
t1k-unity-base-lib-consume(dry-run first; it refuses types referenced from scenes/prefabs). Nothing here consumes.
Rollback: delete the clone (rm -rf "$SCRATCHPAD/lib-clone/<pkg>"). Nothing
upstream exists to roll back — that is the point of emit-don’t-push.
scaffold
Section titled “scaffold”Registry name: t1k-unity-base-lib-packaging#scaffold.
Name first, then create — TheOne.<Area> repo / com.theone.<area> package /
dotted TheOne.<Area> asmdef, decided per t1k-lib-create/references/naming.md
(capability noun, no consumer echo, no engine prefix, no corpus collision). The
registry row is drafted in the same session (hard-gate condition 2 of
t1k-lib-create).
PLAN-ONLY. Emit a plan document and stop:
bun .claude/skills/t1k-lib-create/scripts/t1k-lib-plan.cjs \ plan create-repo inputs.json# PLAN-WRITTEN <action-id> <hash> <plan-path> — relay to spawner, never execute--private is mandatory; the planner refuses --public. The main session runs
each approved step itself.
The plan’s file list must produce studio shape:
TheOne.<Area>/├── package.json # com.theone.<area>├── Runtime/TheOne.<Area>.asmdef # dotted, matches repo name├── Editor/TheOne.<Area>.Editor.asmdef├── Tests/TheOne.<Area>.Tests.asmdef└── .github/workflows/release.yml # theonekit-release-action caller (@v3)Rollback: gh repo archive <owner/name> while it has no consumers — the
create-repo plan’s own rollback step, run by the main session on approval.
References
Section titled “References”- Adapter contract:
theonekit-core→.claude/skills/t1k-lib-contribute/references/adapter-contract.md - Naming:
theonekit-core→.claude/skills/t1k-lib-create/references/naming.md - Planner:
theonekit-core→.claude/skills/t1k-lib-create/scripts/t1k-lib-plan.cjs