Skip to content

t1k:lib-registry

FieldValue
Modulet1k-studio-library
Version2.8.52
Effortmedium
ToolsBash, Edit, Glob, Grep, Read, Skill, Write

Keywords: canonical destination, consolidate libraries, contribute to library, duplicate implementations, library audit, library registry, registry fragment, studio library

/t1k:lib-registry

The studio’s answer to “where does this reusable code belong?” — a per-kit registry of canonical destinations, duplicates and consolidation clusters, with a validator that makes the answer unambiguous.

IntentPath
“Where does a cocos tutorial helper go?”resolve → Resolve
“Is this fragment valid / why is CI red?”validate → Validate
“Show me everything in the registry”list → List
“Is this repo actually enrolled? how many consumers?”audit → Audit
“These two repos look like the same thing”Consolidation

<kit>/.claude/t1k-libraries-<kit>.json — one per engine kit, schema at .claude/schemas/t1k-libraries.schema.json, validated by the script in this skill. Core ships no registry data: the engine kit owns its destinations.

Terminal window
bun .claude/skills/t1k-lib-registry/scripts/t1k-lib-registry.cjs \
resolve --engine cocos --category tutorial

Returns the destination (repo, package, path, contributionTarget) plus the engine’s adapters — the skill names that own the mechanics. Exit 1 with reason: no-canonical or reason: ambiguous; never pick silently on ambiguous — that state fails validate and means the fragment is broken.

Terminal window
bun .claude/skills/t1k-lib-registry/scripts/t1k-lib-registry.cjs validate

Exit 0 clean, 1 with a JSON violation list. The output names the searched root (searchRoot); a root with no .claude/ at all exits 1 with reason: no-claude-dir instead of passing with zero fragments. The rules, each of which has a failing fixture in scripts/__tests__/fixtures/:

  • at most one role: canonical per engine × category
  • role ∈ canonical | legacy | duplicate | template | tool | excluded
  • a clusterId must exist in clusters[]
  • adapter skill names match ^t1k-
  • derived fields are rejected — consumers, enrolled, docCoverage, lastPush, private are computed by audit, never stored (rules/code-conventions.md § “No Derived Fields”)
Terminal window
bun .../t1k-lib-registry.cjs list [--engine unity] [--role duplicate]

Merged view — when two fragments disagree about one row, the higher priority wins and one row comes back, never two.

Terminal window
bun .../t1k-lib-registry.cjs audit # read-only, gh api
bun .../t1k-lib-registry.cjs audit --facts f.json # offline / tests

Emits JSON facts only: visibility, archived, topics, default branch, last push, and a computed enrollment (theone-docs + engine topic, OR a repos.yaml pin for the other-org repos). It writes nothing, ever. Full field list and the enrollment predicate: references/audit.md.

Two repos implementing the same thing are one clusters[] entry with a status, a decisionRef, and — once decided — a canonical. Recording a cluster is a registry edit; migrating consumers is a separate, approved, previewed plan, never a side effect of this skill. See references/consolidation-ledger.md.

Category keys are engine-agnostic (pooling, di, tutorial, joystick-input) so the same vocabulary spans engines. Which roles exist and which one a row should take: references/categories.md.

Runs in t1k-lib-steward (or inline). Resolve, validate, list and audit are deterministic registry reads.

StepAgent
Run scripts/t1k-lib-registry.cjs resolve / validate / list / auditt1k-lib-steward