Skip to content

t1k:unity:sexygame:template-setup

FieldValue
Modulesexygame
Version1.7.2
Efforthigh
Tools—

Keywords: new game from template, production readiness, setup interview, setup this project to production, sgame template setup, tích hợp gameplay mới

/t1k:unity:sexygame:template-setup

t1k-unity-sexygame-template-setup — interview, apply, prove

Section titled “t1k-unity-sexygame-template-setup — interview, apply, prove”

A person who has never seen this repo answers questions; scripts write every answer into the project; gates FAIL (never warn) when an answer is not honoured. Gameplay is the user’s: the skill wires the seam, never writes levels, rules or feel.

One prompt: “setup this project to production”

Section titled “One prompt: “setup this project to production””

This skill is kit-owned (module sexygame of theonekit-unity); the SgameTemplate repo keeps no copy and only a thin bootstrap that forces the newest kit. One sentence to an agent runs the whole chain unattended:

  1. python3 .claude/sgame-template/bootstrap.py (template-derived repo, repo root). It runs t1k modules update (+ t1k modules add sexygame), fails with exit 4 and the exact command when the installed module is older than the latest release (stp-verify.py modules, check modules-latest), then runs the scan below. --offline skips the network checks, --skip-update skips the update (CI).
  2. Scan = auto-discovery, no list kept here. scripts/stp_production.py scan|plan|report --project <UnityProjectRoot> only READS gate output: stp-verify.py all (placeholder identity, ids, keys, store / Firebase / signing values, FTUE, localization, build, release), stp-preflight.py, stp_failures.py scan, stp_interview.py list --open, stp_template_sync.py check, the manual checklist. A new gate shows up in the scan the day it ships.
  3. Follow plan (ordered, de-duplicated fix commands): interview (§2), apply (§3), prove (§4), FTUE with the sibling skill t1k-unity-sexygame-ftue-unlock, localization (mandatory, localization (references/localization.md)), build (prebuild (references/prebuild.md), Jenkins), release gates; re-run report until nothing is left for an agent. The phase driver is driver (references/driver.md).
  4. End state is report’s constant-shape production-readiness report: verdict READY / BLOCKED ON OWNER / NOT READY, the scan table, and section 6 “Cannot be done unattended” (account-bound keys, store consoles, device play, anything needing the owner), each row with its exact next click. Nothing is silently skipped.

Legacy: a game made before this move still holds .claude/skills/sgame-template-setup, sgame-template-sync, sgame-ftue-unlock. Retire them with stp_template_sync.py migrate-legacy (procedure: t1k-unity-sexygame-template-sync/references/migration-from-legacy-skills.md).

<SkillDir> = .claude/skills/t1k-unity-sexygame-template-setup, <RepoRoot> = the git root, <UnityProjectRoot> = the Unity project folder in it (it has Assets/ and ProjectSettings/). Every command below takes the project from --project <UnityProjectRoot>.

§0 · Pick the mode, then read the repo before asking anything

Section titled “§0 · Pick the mode, then read the repo before asking anything”
ModeWhenStart with
FRESH (default)a new clone of the template plus a new gameplay§0 rows below, then §2
SYNCan existing game wants the template’s newer setup (“đồng bộ template”)§6 stp_template_sync.py diff; sync-mode (references/sync-mode.md)
MIGRATEa shipping game moves onto a fresh template treemigrate-existing-game (references/migrate-existing-game.md); scripts/stp-parity.py must print 0 FAIL before any build

Ask nothing the repo can answer. Run python3 <SkillDir>/scripts/stp-preflight.py --project <UnityProjectRoot> first: it prints ONE JSON object (always exit 0) with the facts the disk already holds (identity, seam, modules, ftue, thirdparty, answers, …) and missing[], one <question id>: <prompt> per open cost-A question, derived from the question catalogue. Facts are never asked; a derivable value is derived, not a question. FRESH mode refuses to run on a repo that is not a TOF-integrated SgameTemplate derivative:

#CheckPASSES whenFails as
0theonekit-unity sexygame module declared, installed AND the latest releasestp-verify.py modules exits 0 (modules.pass, incl. modules-latest)STOP: t1k modules update (older than the latest release) or t1k modules add sexygame (project scope) or t1k modules add sexygame --dir "$HOME" --yes (user scope, accepted too), re-run; t1k install exits 0 even when it installs nothing, so trust the gate
17 frozen submodules populatedAssets/TheOneFeature, Assets/TheOneFeature.PuzzleUI, Assets/UITemplate, Assets/TheOne.FTUE, Assets/_Game/PuzzleGame, Packages/com.gdk.core, Packages/com.gdk.3rd each hold files (judge by file count)STOP: not a template derivative
2Assets/Scripts/Editor/TemplateSetup/ presentthe folder and TemplateSetupChecks*.cs existSTOP: the identity/allowlist SSOT is missing
3exactly one IGameplayService implementer1 across Assets/, Packages/, Library/PackageCacheSTOP: repair the seam first
4docs/gameplay-integration.md presentthe guide existsSTOP: older template, use SYNC
5template clone is freshstp_template_sync.py check does not exit 4STOP: git pull --ff-only origin master in the template clone

Full text: contract (data/contract.md). Exit codes everywhere: 0 ok, 1 a check/step FAILED, 2 usage or IO error, 3 cost-A answers incomplete (apply/preflight refuse), 4 stale template clone or environment.

  • Answers: <RepoRoot>/.claude/sgame-setup/answers.json — committed, resumable, never a secret (a secret is {"vault":"<name>"}, stored with t1k vault).
  • Run state (gitignored): <RepoRoot>/.claude/sgame-template-setup.state.json. Game-owned generated files live in <RepoRoot>/.claude/sgame-setup/.
  • Question catalogue: <SkillDir>/data/questions/NN-<section>.json; gates: scripts/gates/stp_gate_<id>.py; apply modules: scripts/apply/stp_apply_<section>.py.
  • Cost classes: A forces a new build, content build, re-encrypt or breaks installed-base compatibility; B is remote/runtime; C is cosmetic.

§2 · The interview loop (resumable, non-interactive for an agent)

Section titled “§2 · The interview loop (resumable, non-interactive for an agent)”
Terminal window
python3 <SkillDir>/scripts/stp_interview.py intro --project <UnityProjectRoot> # "have these ready" list
python3 <SkillDir>/scripts/stp_interview.py next --project <UnityProjectRoot> # JSON: up to 4 AskUserQuestion shapes, cost A first
python3 <SkillDir>/scripts/stp_interview.py record --project <UnityProjectRoot> --id <qid> --value '<json>' # validates, rejects secret-looking text
python3 <SkillDir>/scripts/stp_interview.py record --project <UnityProjectRoot> --id <qid> --default [--reason "..."]
python3 <SkillDir>/scripts/stp_interview.py status --project <UnityProjectRoot> # exit 3 until the A-lock is open
python3 <SkillDir>/scripts/stp_interview.py infer --project <UnityProjectRoot> [--dry-run] [--json] # record what the repo already holds (status derived, by infer, evidence); never overwrites
python3 <SkillDir>/scripts/stp_interview.py list --project <UnityProjectRoot> --open [--json] # every open question; `next --batch N` serves N (default 4, the AskUserQuestion limit)

Send each batch entry as one AskUserQuestion question (header, options, multiSelect as given; free values come through Other); record each answer; repeat next until costAMissing is empty. Resume = run next again: it is a pure function of (answers file, preflight facts, catalogue). Never read a question from a document: the catalogue is the only source. record refuses a value that fails its type rules, a default for a question that has none (defaultable=N), a waiver without a written reason, and text that looks like a credential. See interview (references/interview.md).

A-lock. Apply and the pre-build preflight refuse (exit 3, nothing changed) until every applicable cost-A question is answered, defaulted, derived, waived with a reason, or not applicable, and its value validates. Cost B and C are asked after A and may be deferred with a reason. A deferral is a recorded row, never a pass. Deferring an account-bound cost-A answer (keystore, signing secrets, SDK tokens and keys, console files; the questions marked deferrable): record --id <qid> --status deferred --reason "..." --until <YYYY-MM-DD> [--owner <who>]. The A-lock stays closed (status exit 3, answers-complete-cost-a and the owning gate stay FAIL, --release forbids it), but stp_apply.py run --stage 1|2 runs: it prints WARN apply-deferred-answers, the apply section that consumes a deferred answer (the question’s apply.module) prints SKIP <section>-skipped-deferred and writes nothing (no value is invented; the other sections run), answers-complete-deferred-by-owner is a FAIL finding, and stages 3-4 (the Unity batch) and run all refuse with exit 3 until the answers are recorded.

Release-time items. The privacy URL, terms URL, support email, store title/short/full description/category and the Jenkins keystore credential (id.privacyUrl, id.termsUrl, id.supportEmail, id.storeTitle, id.storeShort, id.storeFull, id.category, sign.jenkinsCredential; marked releaseTime: true) are not setup checks. They never count toward the A-lock, never block apply (stages 0-5, the deferred-blocks-unity guard), and the interview asks them last. Outside --release their gates are WARN release-time item (identity-privacy-url, identity-terms-url, identity-support-email, keystore-jenkins-credential), answers-complete-release-time is SKIP and config-keys-consent is SKIP while consent is on and the privacy URL is unanswered (apply leaves the consent flag off); --release FAILs the required ones (URLs, email, Jenkins credential) until answered or waived; the optional store listing copy is a manual-checklist row that no gate proves. Keystore and secret answers (sign.keystoreFile/Name/alias/storePass/aliasPass, sdk.*) keep their cost-A rules.

Mandatory before apply: scan the known failures. python3 <SkillDir>/scripts/stp_failures.py scan --project <UnityProjectRoot> --offline runs the detect of every catalogue entry against the project. A hit prints its symptom and fix; fix it first (or record why it is accepted), because the same defect has already cost a run once. Exit 0 = clean.

Terminal window
python3 <SkillDir>/scripts/stp_apply.py plan --project <UnityProjectRoot>
python3 <SkillDir>/scripts/stp_apply.py run --project <UnityProjectRoot> all [--dry-run]
python3 <SkillDir>/scripts/stp_apply.py run --project <UnityProjectRoot> --stage 1 | --section identity
StageWhatNotes
0checksanswers valid, A-lock open
1offline text edits in scripts/apply/order.json orderonly through ctx.edit_text (atomic, byte-preserving, idempotent); modules write only the paths they declare; define changes are returned as requests and written by one module
2offline encrypt and font wiringstp-blueprint-encrypt.py; never ForceEncrypt
3ONE Unity batch (Game.Editor.SgameSetupBatch.RunAll): import, ONE compile, font rebake, content build, reportUnity only through the pass runner, headless by default; never touch a user’s open Editor
4ONE test run

Total: one compile, one test run, one content build, at most two launches. Stages 0-2 re-run to an empty diff.

Localization is REQUIRED. stp-verify.py --gates loc-source,loc-locales must exit 0 before done. Rules: localization (references/localization.md) § Source gate.

python3 <SkillDir>/scripts/stp-verify.py all --project <UnityProjectRoot> [--mode game|template] [--release] [--offline] [--json], or --gates a,b,c. Lines are PASS|FAIL|WARN|SKIP <check>: <detail> (SKIP release-offline outside a release run with --offline: never a failure); a gate whose input is missing FAILs <id>-input; a gate not yet implemented FAILs <id>-not-implemented. Mode: --mode, else an answers file => game, else a SgameTemplate repo => template, else game. In template mode the placeholders must stay wired and the identity must stay RENAME_ME; in game mode both are forbidden. --release turns a cost-A WARN into FAIL and refuses --offline. Each answered question names its proof gate checks; the coverage gate fails when they did not run and pass. Gate catalogue and ids: scripts/gates/index.json.

Order of the steps around a build, none of them optional:

  1. stp_failures.py scan --project <UnityProjectRoot> --offline (mandatory before every build, as before apply). A hit is fixed or explained before the build starts.
  2. Pre-build preflight (prebuild (references/prebuild.md); stp_prebuild.py --project <UnityProjectRoot>): a table of every class-A item with how to fix it; exits non-zero while any is unresolved. Do not build on a red row.
  3. Build (stage 3/4 through the Unity pass runner, never by hand).
  4. Post-build smoke checklist (smoke (references/smoke.md); stp_smoke.py render --project <UnityProjectRoot>): <RepoRoot>/.claude/sgame-setup/post-build-smoke.md, one block per booster, FTUE, background, IAP product and locale; a person walks it on a device.
  • Art PRs: render every changed screen before merging (mandatory). Reading prefab YAML to decide which sprite a screen draws is unreliable: nested-prefab overrides compose through the whole variant chain, so the file you read is not the sprite that shows. Before an art PR merges, render each screen it touches in a real Unity run (headless under Xvfb, through the pass runner, never a user’s open Editor), read the screenshots and attach them to the PR. stp_sprite_audit.py (gate sprite-audit, art-slots (references/art-slots.md)) names the candidates; the render decides.
  • Known failures: references/known-failures.md is rendered from data/failures/*.json by stp_failures.py. Consult it before debugging any failing gate or build. A new failure MUST be recorded with stp_failures.py add (then render) in the same change that fixes it, so the next run’s scan catches it. The failures-registry gate fails for a FAIL-capable gate with no entry.

python3 <SkillDir>/scripts/stp_template_sync.py diff|check|pull|backport|baseline|registry-lint --template <clone> | --template-ref github:The1Studio/SgameTemplate@master compares by sha256 against the ownership registry .claude/sgame-template/ownership.json and a three-way baseline .claude/sgame-setup/template-sync.json. Agent procedure for pulling and backporting (preflight, conflicts, commit): the t1k-unity-sexygame-template-sync skill (.claude/skills/t1k-unity-sexygame-template-sync/SKILL.md).

ClassOwnerSync behaviour
templatetemplatepulled when only the template changed; a game-side edit is a backport candidate; both changed = conflict (never auto-resolved: --take-template / --keep-game)
mixedbothonly the template skeleton is compared; marker regions (stp:fact, stp:gen, stp:identity, stp:ledger-*) are the game’s; a recorded --keep-game choice follows an apply module’s own edit of the file
seedgame after first copycopied only when absent (placeholder PNGs and .meta)
generatedgame renders itthe game’s own render is never overwritten, but drift is judged against the game’s OWN renderer via the rule’s renderCheck: a file the game does not hold is missing-generated, and one it holds that its renderer no longer reproduces (the input moved under it after delivery) is stale-generated. Both are drift: check FAILs and pull --apply runs the rule’s renderer IN THE GAME (a game that cannot render gets the template’s copy as a named STAND-IN; a stale file whose renderer fails is left in place as STALE, never overwritten with the template’s document). A generated rule with no renderCheck leaves a held file diverged-ok and says the freshness was not verified
game, data-defaultgamenever pulled (answers, state, smoke, tuned blueprints)
pending-markersgame until markers existtreated as game; registry-lint fails once markers appear so the class gets flipped to mixed

The shared Wallpaper scripts (Assets/Scripts/Wallpaper/*.cs) and Assets/Prefabs/Wallpaper/CanvasBackground Variant.prefab (+ .meta) are template-owned: a game that lacks the gradient/SetContext change gets them with pull, then re-runs the backgrounds apply. pull classifies with the template’s .claude/sgame-template/ownership.json, so one pull works on an older game. A stale template clone exits 4: pull it first. pull is a dry run until --apply. Process rule: every fix made while setting up a game that is not game-specific is backported to SgameTemplate in the same session (stp_template_sync.py backport --to <template worktree>), as a PR, tracked as a task, and recorded in the known-failures catalogue.

Trigger once; it runs interview -> apply -> prove with no hand-holding beyond the questions. The driver (driver (references/driver.md)) walks P0-P10 below. Human-only gates and deferred answers append a row to <RepoRoot>/.claude/sgame-template-setup-manual-checklist.md and never halt the run; deferring is not passing. Unity policy: driver §4 (references/driver.md). Git: work on setup/<ProjectSlug> from master, pathspec commits, push once at the end; the Jenkins job builds that branch.

The driver’s checklist of P0–P11 plus End, with each phase’s reference and its falsifiable gate command, is phase-table (references/phase-table.md). Read it at Stage 0 and run every row’s gate; a phase is not done until its gate cell passes.

  • Android only: the template builds Android only and carries no IAP unless mon.iap.enabled is answered; the skill asks no platform question and demands nothing for iOS (maintaining-the-template (references/maintaining-the-template.md)). A red build runs the autofix loop scripts/stp_build_autofix.py (jenkins-build (references/jenkins-build.md)).
  • Frozen, read-only: Packages/com.gdk.*, Assets/UITemplate, Assets/TheOneFeature, Assets/TheOneFeature.PuzzleUI, Assets/TheOne.FTUE, Assets/_Game/PuzzleGame. Fix a defect upstream and bump the pointer — never edit them in place.
  • Third-party allowlist — AppLovin MAX (incl. its mediation adapters and AdQuality, which are part of the AppLovin integration) · Adjust · Firebase · ByteBrew. Nothing else, ever. Assets/PlayFabSDK stays as a compile-only dependency of a frozen asmdef: never register it, never configure it (WARN, not FAIL).
  • Naming: project-owned names use “Sgame” (Sgame/Template/Setup Checklist, Sgame/Placeholder/*). Frozen names stay as they are — TheOne/Feature Hub, TheOne/Validator.
  • Coding conventions: VContainer · UniTask · LitMotion (no DOTween) · mandatory this. · camelCase private fields with no underscore · prefab-only UI (never code-built GameObjects) · IObjectPoolManager for runtime spawns · depend on interfaces, never concrete classes.
  • Secrets: never commit a keystore, and never commit the state file (it holds Stage 0 answers). Default policy for client keys: commit the client-side Adjust/MAX/ByteBrew/Firebase config (they are client-embedded anyway) — but ask before committing them; the user may prefer Jenkins-injected secrets. Never echo a secret VALUE into chat, into state, or into a command.
  • Gameplay is the user’s. In mode (c) the skill scaffolds the seam only — it never generates a loop, levels or mechanics.

Every trap this skill has already hit (reward art, loading title, pins, hygiene, migration) is hard rules (references/hard-rules.md). Read it before P2 and again before the first build.

Rules for the person who edits the template itself (blueprints, localization, release, rebasing from a source game): maintaining-the-template (references/maintaining-the-template.md).

Relationship to the sexygame module skills

Section titled “Relationship to the sexygame module skills”

The template requires the theonekit-unity T1K module sexygame (§0 row 0), which ships:

SkillUse it for
t1k:unity:sexygame:setup (.claude/skills/t1k-unity-sexygame-setup/)the full TOF/sexy-layer integration of a gameplay-only project — the deep reference for P1–P8: bootstrap, seam, data pipeline, feature entry UX, monetization, sexy layer, FTUE, parity, addresses, secrets, placeholders. Deeper reading, inside that skill: t1k-unity-sexygame-setup/references/known-traps.md, t1k-unity-sexygame-setup/references/phase-*.md, t1k-unity-sexygame-setup/references/worked-example-config-values.md
t1k:unity:sexygame:rc-variants (.claude/skills/t1k-unity-sexygame-rc-variants/)switching a game’s Firebase Remote Config between the marketing and store-review variants (FeatureEntry, user_experience) — P1 writes the initial state, P10 builds the requested one

This skill still owns the run — the phase order, the gates and the state file are here; the module’s skills supply the domain procedure those phases follow. Consult them when a phase needs the TOF or sexy-layer mechanism in depth, and never fork their content into this skill. A missing module is a STOP (§0), not a degraded run.

  • Not a derivative AND no sync wanted: run t1k:unity:sexygame:setup to integrate from scratch.
  • One phase only (say a Jenkins build): invoke the sibling skill (t1k-jenkins-unity, t1k-unity-base-addressables, t1k-unity-base-blueprint-csv).
  • You want the gameplay itself written: this skill wires the seam, never authors a loop or levels.
  • A Release build is the goal: release fails while placeholders remain; finish P1-P9, then build by hand.