t1k:unity:base:dup-scan
| Field | Value |
|---|---|
| Module | base |
| Version | 5.116.6 |
| Effort | medium |
| Tools | Bash, Glob, Grep, Read |
Keywords: copied scaffold, copy paste across repos, cross-repo duplicates, duplicate census, duplicated code across games, jscpd csharp, template provenance, unity dup scan
How to invoke
Section titled “How to invoke”/t1k:unity:base:dup-scanUnity Cross-Repo Duplicate Census: bindings for the gamedev census
Section titled “Unity Cross-Repo Duplicate Census: bindings for the gamedev census”Answers “what C# do our Unity games copy from each other, and where did it come from?”. The method (stages,
marks, Judge, hand-off, scoping of negatives, JSON report contract) is the engine-neutral skill
t1k:gamedev:reuse:duplicate-census of theonekit-gamedev (module reuse, a dependency of this module); read and
follow it. This skill carries the Unity-bound tool (scripts/dup-scan.cjs) and binds the skill’s slots to it. The
adapter entry is capabilities.x-dupcensus of t1k-unity-base-gamedev-adapter/gamedev-adapter.json.
Read-only. Clones land in --workdir (a temp dir); nothing is pushed or written to a scanned repo, the registry
or GitHub.
Slot bindings
Section titled “Slot bindings”| Slot | Unity value |
|---|---|
command | bun .claude/skills/t1k-unity-base-dup-scan/scripts/dup-scan.cjs with --dry-run, --smoke N, --full, --repos, --config, --local, --out |
requires | gh (authenticated, org read), git 2.27 or newer, bun 1.4.3 or newer, jscpd 4 or newer (bun add -g jscpd); declared in install.json; the script checks each one it will use and exits 2 naming it |
sourceExt / sourceRoot | .cs / Assets (the one holding the most .cs files); the report names the root repos[].assetsRoot where the neutral contract says sourceRoot (scripts/lib/report.cjs) |
config | scripts/dup-scan.config.json: templateRepos, templateNamePatterns, libraryTopics (theone-docs), libraryNamePatterns, vendorPathSegments, vendorMarkerFiles, vendorNamespaceRoots; the shipped vendor lists carry every full-census addition |
coverageGap | embedded first-party UPM packages under a repo-root Packages/ and any second Assets/ tree are never read |
Run - smoke first, always
Section titled “Run - smoke first, always”S=.claude/skills/t1k-unity-base-dup-scan/scriptsbun $S/dup-scan.cjs --dry-run # population only: counts, excluded + whybun $S/dup-scan.cjs # SMOKE: first 5 game repos (most recently pushed)bun $S/dup-scan.cjs --full --workdir <scratch>/dup # all game repos, only after the gate below| Flag | Default | Use |
|---|---|---|
--org / --pushed-since-days / --since | config: The1Studio / 210 | population window |
--repos A,B | none | scan exactly these (templates still indexed unless named here) |
--smoke N / --full | 5 / off | preview size (positive integer, else exit 2) / whole population |
--min-tokens N | 30 | jscpd threshold; report it with every number |
--max-lines N / --max-size S | 20000 / 2mb | jscpd per-file limits; files over them are counted in meta.jscpdLimits and warned |
--concurrency N | config cloneConcurrency (8) | clones in flight at once (positive integer, else exit 2); per-phase seconds land in meta.phaseSeconds |
--config FILE | scripts/dup-scan.config.json | override any key; a list you pass REPLACES the default list |
--project-root DIR | cwd | where .claude/t1k-libraries-*.json is discovered |
--local DIR | none | scan existing checkouts offline (one subdir per repo) |
--no-registry / --no-provenance / --no-jscpd | off | degrade explicitly; each is warned in the report |
Output: <out>/dup-scan.json + dup-scan.md (default <workdir>/report), and a summary on stdout. Clones are
reused from the same --workdir only when they carry the tool’s owner marker (.git/t1k-unity-dup-scan.owner); an
existing staging/ without its marker is refused (exit 2) and an unmarked repos/<name>/ is skipped.
Upgrading from a pre-marker version: pass a fresh --workdir (the default already is one) and delete the old
one yourself. A dup-scan.json with schemaVersion: 1 still has sibling-fork groups inside
exactGroups/nearGroups; v2 moves them to forkGroups.
Executed by
Section titled “Executed by”Runs inline in the main session (or an inline sub-agent Bash call): dup-scan.cjs is a deterministic script
invocation, read-only, smoke first. The Judge step after it is reasoning and stays with the caller. No sub-agent fan-out.
Unity judging notes
Section titled “Unity judging notes”- Framework idiom vs copy: VContainer scopes, UITemplate screen and popup presenters and service-registration blocks look alike because they are written against the same framework.
- Vendor leak: a group that is SDK code (Facebook, PlayFab, DOTween) means a vendor root is missing; add it to
vendorNamespaceRoots/vendorPathSegmentsin a config override and re-run. - Unity mechanics of a confirmed CANDIDATE:
t1k-unity-base-lib-packaging#contribute(destination viat1k-lib-registry resolve). - The core
t1k-lib-registry.cjsmust be installed (or pass--no-registry); a registry that returns 0 unity rows is an error, not an empty index. - Package-shaped repos (no
Assets/root plus a rootpackage.jsonorRuntime/*.asmdef) are moved from game to library after the clone, with a warning.