tea-x-random/unity-game-skills/unity-project-setup

Claude Code and agent skill by tea-x-random/unity-game-skills

Trust tier 3
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

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-setup

Semi-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)

  1. Configure source control correctly once, on day zero. Unity's binary assets and .meta sidecar files make naive Git painful — a wrong .gitignore or a missing LFS rule is far cheaper to fix before there are 50 commits and 4 GB of textures than after.
  2. Always commit `.meta` files; never commit `Library/`. A .meta is 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.
  3. 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.
  4. 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 (see unity-ios-secure-backend, unity-monetization).
  5. 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)

  1. Source control first. Add the Unity .gitignore and .gitattributes (+ Git LFS) before the first asset commit. Copy both from references/gitignore-and-lfs.md.
  2. Editor settings. Set Asset Serialization = Force Text, Version Control = Visible Meta Files, configure Smart Merge (UnityYAMLMerge). Commit ProjectSettings/.
  3. Folder structure. Create Assets/<Game>/ with the standard subfolders; keep generated/third-party separate. Provision the reserved art-pipeline paths with .gitkeep files (below).
  4. Assembly architecture. Lay down Core / Game / Editor / Tests asmdefs (engine-free Core first).
  5. Package management. Pin versions in manifest.json, add OpenUPM scoped registries as needed, commit packages-lock.json.
  6. Versioning. Decide bundleVersion + build-number scheme; add the build-number bump (hand iOS signing/upload to unity-qa-release fastlane).
  7. Secrets/config. Add per-env config + a .gitignored secrets file; document the env vars CI must inject.
  8. CI/CD. Wire build-on-push (Unity CLI/MCP) → run tests → fastlane signing/upload. Keep BuildScript.PerformiOSBuild as 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 ignore Assets/, ProjectSettings/, Packages/manifest.json, or *.meta. Full copyable file in references/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. Run git lfs install once per machine; commit .gitattributes before adding the binaries (LFS only captures files matched at commit time — pre-existing blobs must be migrated with git lfs migrate). Patterns in references/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 UnityYAMLMerge tool as the mergetool for .unity / .prefab so structural scene/prefab conflicts merge semantically instead of corrupting YAML. Config in references/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:

text
Assets/
<Game>/ # everything you author lives under one namespace-like root
Scripts/ # C# (mirrors the asmdef layout: Core/, Game/, Editor/, Tests/)
Art/ # Textures, Sprites, Materials, Models (LFS-tracked)
_ArtDirection/ # RESERVED: art-spec.yaml, style-guide.md, palettes/, references/, sheets/
Approved/ # RESERVED: registry.yaml + <asset_id>/ (contract + approved art + QA reports)
Source/ # RESERVED: raw generated staging — SourceImages/, TripoRaw/, CleanupQueue/, QA/
Audio/ # Music, SFX (LFS-tracked)
Prefabs/
Scenes/ # Boot, Game, plus additive feature scenes
UI/ # UI Toolkit (UXML/USS) or uGUI prefabs
Data/ # ScriptableObjects, config assets
Tests/ # EditMode + PlayMode (Tests asmdefs)
Settings/ # URP assets, Input Actions, etc.
Plugins/ # native plugins (.framework, .a, iOS bridge)
ThirdParty/ # imported .unitypackage / vendor SDKs — kept OUT of <Game>/
Packages/ # manifest.json + packages-lock.json (committed)
ProjectSettings/ # committed
Build/ # gitignored output (Build/iOS/ is the Xcode export)

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:

bash
mkdir -p "Assets/<Game>/Art/_ArtDirection"/{palettes,references,sheets} \
"Assets/<Game>/Art/Approved" \
"Assets/<Game>/Art/Source"/{SourceImages,TripoRaw,CleanupQueue,QA}
find "Assets/<Game>/Art" -type d -empty -exec touch {}/.gitkeep \;
  • 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.json beside them); registry Assets/<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/ and Assets/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.)

AssemblyContentsKey setting
<Game>.CorePure 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 CoreRuntime 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. Core cannot reference Game or UnityEngine, so logic can't accidentally couple to scene objects. The compiler is the guardrail.
  • Real, fast unit tests. Engine-free Core runs 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 a scopedRegistries entry pointing at https://package.openupm.com with the exact scopes, so only the named packages come from OpenUPM:
json
"scopedRegistries": [
{
"name": "OpenUPM",
"url": "https://package.openupm.com",
"scopes": ["com.google", "com.google.external-dependency-manager"]
}
]

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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/tea-x-random/unity-game-skills/unity-project-setup/badge)](https://verified-skill.com/skills/tea-x-random/unity-game-skills/unity-project-setup)

Something wrong with this skill or its page? Tell us.