knowledge-sweep-unity
Unity Reuse Loop: Ask the Studio Before You Build
Section titled “Unity Reuse Loop: Ask the Studio Before You Build”Before writing new Unity code, find out whether the studio already has it. Loads when Unity files are
touched. Procedure: skill t1k:unity:base:knowledge-sweep.
When it runs
Section titled “When it runs”Before you author a new class, system, service, ScriptableObject or prefab, and before a plan or brainstorm proposes one. Skip only when the exact symbol is already known.
The steps
Section titled “The steps”-
doc_search(mcp__knowledge-retrieval__), engineunity, before anything else. -
Code graphs:
code-graph-unity(studio library), thencode-graph-unity-games(games, demos). -
Grep the working tree, never skipped. Look first in the studio library, TheOneFeature (TOF), TheOneRPG and
unity-dots-library, thenAssets/. -
Record one line in the turn, then act on it:
reuse-verdict: NEW — <symbol or package> — scope: <what you searched> — reason: <the game-specific part>Write ONE word and then the dash: the gate rejects a
REUSE|EXTEND|…alternation.NEWhere may be any accepted verdict —REUSE,EXTEND,CONTRIBUTE,KEEPorunverified.REUSEuse it, never copy it ·EXTENDchange it at its source, library first ·NEWonly after a miss, for game-specific code:reason:names the game-specific part (20+ chars, as forKEEP). A fullreuse-search:record (docs/reuse-search-record.md) also counts.
Library-first, contribute-back
Section titled “Library-first, contribute-back”Features and the meta layer (hub, shop, ads, wallet, quests, FTUE, save, time) COME FROM the studio libs (TOF, TheOneRPG, gdk.core, UITemplate, unity-dots-library, studio packages); generic game code GOES BACK to them.
- Search the libs first; pick the owner with
t1k-lib-registry(resolve --engine unity --category <c>). - Adapt through the lib’s seams. Never fork or locally patch a package or submodule.
- Not found → classify:
- Reusable (no game-specific names, content, data, tuning or rules) →
CONTRIBUTE: PR to the lib via/t1k:lib-contribute(skillt1k-lib-contribute) in the SAME task; compile-gate it on the game. The game consumes the UPM package, never a copy. - Game-specific →
NEW/KEEPin the game, with a one-line reason naming the game-specific part. “Only this game needs it” is not a reason.
- Reusable (no game-specific names, content, data, tuning or rules) →
- Default when unsure: CONTRIBUTE.
- Not merged yet: consume the branch or pre-release, never a permanent copy; re-pin in the PR body.
- Split mixed code: the mechanism goes to the lib; data, config and content stay in the game.
Detail, examples and the core-hook enforcement: docs/library-first-contribute-back.md.
Provenance
Section titled “Provenance”A tool that is missing is graph: unavailable or unverified, never a negative. A miss states its
scope (negative-result-scope.md): never a bare “greenfield”.