t1k:unity:sexygame:template-setup
| Field | Value |
|---|---|
| Module | sexygame |
| Version | 1.7.2 |
| Effort | high |
| 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
How to invoke
Section titled “How to invoke”/t1k:unity:sexygame:template-setupt1k-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:
python3 .claude/sgame-template/bootstrap.py(template-derived repo, repo root). It runst1k 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, checkmodules-latest), then runs the scan below.--offlineskips the network checks,--skip-updateskips the update (CI).- 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. - Follow
plan(ordered, de-duplicated fix commands): interview (§2), apply (§3), prove (§4), FTUE with the sibling skillt1k-unity-sexygame-ftue-unlock, localization (mandatory, localization (references/localization.md)), build (prebuild (references/prebuild.md), Jenkins), release gates; re-runreportuntil nothing is left for an agent. The phase driver is driver (references/driver.md). - End state is
report’s constant-shape production-readiness report: verdictREADY/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”| Mode | When | Start with |
|---|---|---|
| FRESH (default) | a new clone of the template plus a new gameplay | §0 rows below, then §2 |
| SYNC | an existing game wants the template’s newer setup (“đồng bộ template”) | §6 stp_template_sync.py diff; sync-mode (references/sync-mode.md) |
| MIGRATE | a shipping game moves onto a fresh template tree | migrate-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:
| # | Check | PASSES when | Fails as |
|---|---|---|---|
| 0 | theonekit-unity sexygame module declared, installed AND the latest release | stp-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 |
| 1 | 7 frozen submodules populated | Assets/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 |
| 2 | Assets/Scripts/Editor/TemplateSetup/ present | the folder and TemplateSetupChecks*.cs exist | STOP: the identity/allowlist SSOT is missing |
| 3 | exactly one IGameplayService implementer | 1 across Assets/, Packages/, Library/PackageCache | STOP: repair the seam first |
| 4 | docs/gameplay-integration.md present | the guide exists | STOP: older template, use SYNC |
| 5 | template clone is fresh | stp_template_sync.py check does not exit 4 | STOP: git pull --ff-only origin master in the template clone |
§1 · The contract in one screen
Section titled “§1 · The contract in one screen”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 witht1k 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)”python3 <SkillDir>/scripts/stp_interview.py intro --project <UnityProjectRoot> # "have these ready" listpython3 <SkillDir>/scripts/stp_interview.py next --project <UnityProjectRoot> # JSON: up to 4 AskUserQuestion shapes, cost A firstpython3 <SkillDir>/scripts/stp_interview.py record --project <UnityProjectRoot> --id <qid> --value '<json>' # validates, rejects secret-looking textpython3 <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 openpython3 <SkillDir>/scripts/stp_interview.py infer --project <UnityProjectRoot> [--dry-run] [--json] # record what the repo already holds (status derived, by infer, evidence); never overwritespython3 <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.
§3 · Apply — fewest Unity passes
Section titled “§3 · Apply — fewest Unity passes”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.
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| Stage | What | Notes |
|---|---|---|
| 0 | checks | answers valid, A-lock open |
| 1 | offline text edits in scripts/apply/order.json order | only 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 |
| 2 | offline encrypt and font wiring | stp-blueprint-encrypt.py; never ForceEncrypt |
| 3 | ONE Unity batch (Game.Editor.SgameSetupBatch.RunAll): import, ONE compile, font rebake, content build, report | Unity only through the pass runner, headless by default; never touch a user’s open Editor |
| 4 | ONE test run |
Total: one compile, one test run, one content build, at most two launches. Stages 0-2 re-run to an empty diff.
§4 · Prove it — gates
Section titled “§4 · Prove it — gates”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.
§5 · Before and after the first build
Section titled “§5 · Before and after the first build”Order of the steps around a build, none of them optional:
stp_failures.py scan --project <UnityProjectRoot> --offline(mandatory before every build, as before apply). A hit is fixed or explained before the build starts.- 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. - Build (stage 3/4 through the Unity pass runner, never by hand).
- 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(gatesprite-audit, art-slots (references/art-slots.md)) names the candidates; the render decides. - Known failures:
references/known-failures.mdis rendered fromdata/failures/*.jsonbystp_failures.py. Consult it before debugging any failing gate or build. A new failure MUST be recorded withstp_failures.py add(thenrender) in the same change that fixes it, so the next run’sscancatches it. Thefailures-registrygate fails for a FAIL-capable gate with no entry.
§6 · Template sync and the process rule
Section titled “§6 · Template sync and the process rule”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).
| Class | Owner | Sync behaviour |
|---|---|---|
| template | template | pulled when only the template changed; a game-side edit is a backport candidate; both changed = conflict (never auto-resolved: --take-template / --keep-game) |
| mixed | both | only 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 |
| seed | game after first copy | copied only when absent (placeholder PNGs and .meta) |
| generated | game renders it | the 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-default | game | never pulled (answers, state, smoke, tuned blueprints) |
| pending-markers | game until markers exist | treated 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.
§7 · Run contract
Section titled “§7 · Run contract”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.
Phase table
Section titled “Phase table”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.
Constraints (non-negotiable)
Section titled “Constraints (non-negotiable)”- Android only: the template builds Android only and carries no IAP unless
mon.iap.enabledis 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 loopscripts/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/PlayFabSDKstays 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) ·IObjectPoolManagerfor 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.
Hard rules
Section titled “Hard rules”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.
Maintaining the template (owner rules)
Section titled “Maintaining the template (owner rules)”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:
| Skill | Use 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.
When NOT to use
Section titled “When NOT to use”- Not a derivative AND no sync wanted: run
t1k:unity:sexygame:setupto 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.