t1k:lib-registry
| Field | Value |
|---|---|
| Module | t1k-studio-library |
| Version | 2.8.52 |
| Effort | medium |
| Tools | Bash, Edit, Glob, Grep, Read, Skill, Write |
Keywords: canonical destination, consolidate libraries, contribute to library, duplicate implementations, library audit, library registry, registry fragment, studio library
How to invoke
Section titled “How to invoke”/t1k:lib-registryLibrary Registry
Section titled “Library 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.
Decision Tree
Section titled “Decision Tree”| Intent | Path |
|---|---|
“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 |
Where fragments live
Section titled “Where fragments live”<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.
Resolve
Section titled “Resolve”bun .claude/skills/t1k-lib-registry/scripts/t1k-lib-registry.cjs \ resolve --engine cocos --category tutorialReturns 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.
Validate
Section titled “Validate”bun .claude/skills/t1k-lib-registry/scripts/t1k-lib-registry.cjs validateExit 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: canonicalper engine × category role∈ canonical | legacy | duplicate | template | tool | excluded- a
clusterIdmust exist inclusters[] - adapter skill names match
^t1k- - derived fields are rejected —
consumers,enrolled,docCoverage,lastPush,privateare computed byaudit, never stored (rules/code-conventions.md§ “No Derived Fields”)
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.
bun .../t1k-lib-registry.cjs audit # read-only, gh apibun .../t1k-lib-registry.cjs audit --facts f.json # offline / testsEmits 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.
Consolidation
Section titled “Consolidation”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.
Categories and roles
Section titled “Categories and roles”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.
Executed by
Section titled “Executed by”Runs in t1k-lib-steward (or inline). Resolve, validate, list and audit are deterministic registry reads.
| Step | Agent |
|---|---|
Run scripts/t1k-lib-registry.cjs resolve / validate / list / audit | t1k-lib-steward |