tea-x-random/unity-game-skills/unity-project-setup
Claude Code and agent skill by tea-x-random/unity-game-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Establish a reproducible Unity 6 project foundation before the codebase grows. Use for new repos, Unity .gitignore, .gitattributes/Git LFS, Force Text serialization, Visible Meta Files, Smart Merge/UnityYAMLMerge, committed .meta files, per-game Assets layout, asmdef Core/Game/Editor/Tests architecture, UPM manifest.json, packages-lock.json, OpenUPM/scoped registries, version pinning, bundle/build numbers, environment config, secrets, API keys, CI/CD, headless tests/builds, fastlane and iOS upload. Pair with unity-gameplay-systems for architecture, unity-qa-release for builds/signing, unity-mcp-bridge for Editor automation, and monetization/analytics skills for per-environment SDK configuration.
Install
npx vskill@latest install tea-x-random/unity-game-skills/unity-project-setupSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as tea-x-random/unity-game-skills/unity-project-setup.
Unity Project Setup
Purpose
Lay down the repo and build foundation a team can grow on: correct Unity-aware source control, a predictable folder + assembly layout, reproducible package management, a versioning scheme, a secrets stance, and CI/CD wiring — so the first playable (and everything after) lands in a structure that doesn't fight merges, leak keys, or rot into 20-minute compiles.
Use When
Starting a new Unity repo (or rescuing one set up naively); fixing Git pain (huge repo, scene merge conflicts, broken references after pull); designing assembly architecture; pinning packages for reproducibility; deciding a version/build-number scheme; removing committed secrets; or standing up CI that builds + tests + hands iOS signing to fastlane.
This is the production-engineering / DevOps hygiene discipline. It is distinct from unity-gameplay-systems (which scaffolds the first PLAYABLE) — this skill owns the repo/build foundation that the playable lives inside.
Doctrine (set this up BEFORE the project grows)
- Configure source control correctly once, on day zero. Unity's binary assets and
.metasidecar files make naive Git painful — a wrong.gitignoreor a missing LFS rule is far cheaper to fix before there are 50 commits and 4 GB of textures than after. - Always commit `.meta` files; never commit `Library/`. A
.metais the asset's identity (GUID + import settings). A missing or orphaned meta silently breaks every reference to that asset.Library/is a regenerable cache — committing it bloats the repo and conflicts constantly. - Reproducible builds beat "works on my machine." Pin package versions, commit
packages-lock.json, and keep one headless build entry point so CI and a teammate's clone produce the same artifact. - Secrets never touch the repo. Ad unit IDs, analytics keys, signing creds, App Store API keys → environment variables / per-env config / CI secrets, with the secret files
.gitignored. This reinforces the repo's own security stance (seeunity-ios-secure-backend,unity-monetization). - Architecture is enforced by assemblies, not by good intentions. An engine-free Core in its own asmdef gives fast compiles, real unit tests, and dependency boundaries the compiler actually checks.
Workflow (new repo, in order)
- Source control first. Add the Unity
.gitignoreand.gitattributes(+ Git LFS) before the first asset commit. Copy both fromreferences/gitignore-and-lfs.md. - Editor settings. Set Asset Serialization = Force Text, Version Control = Visible Meta Files, configure Smart Merge (UnityYAMLMerge). Commit
ProjectSettings/. - Folder structure. Create
Assets/<Game>/with the standard subfolders; keep generated/third-party separate. Provision the reserved art-pipeline paths with.gitkeepfiles (below). - Assembly architecture. Lay down Core / Game / Editor / Tests asmdefs (engine-free Core first).
- Package management. Pin versions in
manifest.json, add OpenUPM scoped registries as needed, commitpackages-lock.json. - Versioning. Decide bundleVersion + build-number scheme; add the build-number bump (hand iOS signing/upload to
unity-qa-releasefastlane). - Secrets/config. Add per-env config + a
.gitignored secrets file; document the env vars CI must inject. - CI/CD. Wire build-on-push (Unity CLI/MCP) → run tests → fastlane signing/upload. Keep
BuildScript.PerformiOSBuildas the single Editor-driven entry point CI calls.
Source control essentials
Unity Git pain is almost entirely preventable with five settings. Get them right once.
- `.gitignore` (Unity-specific). Ignore the regenerable/local stuff:
Library/,Temp/,Obj//obj/,Build/&Builds/,Logs/,UserSettings/,.vs/,.idea/,*.csproj/*.sln(regenerated), crash/burst artifacts. Never ignoreAssets/,ProjectSettings/,Packages/manifest.json, or*.meta. Full copyable file inreferences/gitignore-and-lfs.md. - `.gitattributes` + Git LFS for binaries. Track large binary asset types (textures
.png/.psd/.tga/.exr, models.fbx/.blend, audio.wav/.mp3/.ogg, video.mp4, fonts,.unitypackage) with Git LFS so the repo stays clone-able and diffs stay sane. Rungit lfs installonce per machine; commit.gitattributesbefore adding the binaries (LFS only captures files matched at commit time — pre-existing blobs must be migrated withgit lfs migrate). Patterns inreferences/gitignore-and-lfs.md. - Asset Serialization = Force Text.
Edit ▸ Project Settings ▸ Editor ▸ Asset Serialization ▸ Mode = Force Text. Makes scenes/prefabs/assets YAML so they diff and merge (and so Smart Merge can run). Binary serialization is unmergeable. - Version Control = Visible Meta Files.
Edit ▸ Project Settings ▸ Editor ▸ Version Control ▸ Mode = Visible Meta Files. Ensures every asset has a tracked.meta(its GUID + import settings). Always commit `.meta` files — a missing or orphaned meta reassigns GUIDs and silently breaks references; an extra meta for a deleted asset is noise but harmless. Treat "added/deleted an asset without its meta" as a broken commit. - Smart Merge (UnityYAMLMerge). Register Unity's
UnityYAMLMergetool as the mergetool for.unity/.prefabso structural scene/prefab conflicts merge semantically instead of corrupting YAML. Config inreferences/gitignore-and-lfs.md. Even so: minimize concurrent edits to the same scene — split work into prefabs and additive scenes so two people rarely touch one.unity.
Project / folder structure
Keep one game-owned root so third-party imports and generated output never intermingle with your source:
Rationale: a single Assets/<Game>/ root makes "what we wrote" vs "what we imported" obvious, keeps reorg cheap (one move, not a scatter), and lets .gitignore/LFS rules target predictable paths.
Reserved art-pipeline paths (provision at setup)
The art pipeline (unity-art-direction → unity-asset-pipeline) resumes across sessions only if its artifact paths are deterministic — unity-game-director's detect probe looks for them. Provision them empty at setup, with .gitkeep files so the dirs survive git:
- Canonical artifact paths: art-spec
Assets/<Game>/Art/_ArtDirection/art-spec.yaml; master palette_ArtDirection/palettes/master-palette.png; canon sheets_ArtDirection/sheets/<char_id>_canon.png(skeleton templates*.skeleton.jsonbeside them); registryAssets/<Game>/Art/Approved/registry.yaml. - This nests the whole art tree under the single
Assets/<Game>/root — the one-root doctrine holds; never invent a new root for art output. - Legacy reserved aliases: older skill docs use
Assets/GameArt/andAssets/Art/roots. Discovery/resume tooling MUST probe them too, but NEW artifacts are written to the canonical layout only. Unifying legacy references is follow-up polish, not a setup blocker.
Assembly definition (asmdef) architecture
Default Unity dumps all scripts into one implicit Assembly-CSharp — every edit recompiles everything and nothing enforces boundaries. Split into explicit assemblies. (Cross-ref unity-gameplay-systems, which builds the first playable inside exactly this layout.)
| Assembly | Contents | Key setting | |
|---|---|---|---|
<Game>.Core | Pure C# game logic — rules, state, generators, scoring, puzzle/solver. No `UnityEngine` where possible. | "noEngineReferences": true (or "Override References" + no UnityEngine) → fast, deterministic, EditMode-testable in milliseconds | |
<Game> | MonoBehaviours, scene glue, views; references Core | Runtime platforms | |
<Game>.Editor | [MenuItem], importers, `BuildScript.PerformiOSBuild` | "includePlatforms": ["Editor"] so it never ships in the player | |
<Game>.Tests (+ .Tests.Editor) | EditMode/PlayMode tests; references Core (and Game for PlayMode) | References UnityEngine.TestRunner / nunit |
Why it matters:
- Faster compiles & shorter domain reloads. Editing a leaf assembly recompiles only it and its dependents — not the whole game. (Each compile triggers the ~5s MCP domain-reload drop; fewer recompiles = fewer drops, see
unity-mcp-bridge.) - Enforced dependencies.
Corecannot referenceGameorUnityEngine, so logic can't accidentally couple to scene objects. The compiler is the guardrail. - Real, fast unit tests. Engine-free
Coreruns in EditMode with no scene, no Play Mode, no frame loop — generators/solvers/scoring get tested in milliseconds in CI. - Editor code never ships. Build tooling in an Editor-platform asmdef is excluded from the player automatically.
Reference asmdefs by name; keep cross-references minimal (fewer edges = shorter reloads). Add the Input System / TMP / test assemblies explicitly where used.
Package management (reproducible)
- `Packages/manifest.json` is the source of truth. Declare every dependency with a pinned exact version (
"com.unity.inputsystem": "1.11.2"), not a floating range — floating versions make two clones resolve differently. - Commit `Packages/packages-lock.json`. It records the fully-resolved dependency graph (including transitive deps and registry sources) so every clone and CI run resolves identically. Treat a lockfile change in a PR as a real, reviewable diff.
- OpenUPM scoped registries for packages not in Unity's registry (e.g. Google Mobile Ads — see
unity-monetization). Add ascopedRegistriesentry pointing athttps://package.openupm.comwith the exact scopes, so only the named packages come from OpenUPM:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/unity-project-setup/SKILL.md
Popularity
- Repository stars
- 3
- 7-day trend score
- 7
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tea-x-random/unity-game-skills/unity-project-setup)