Skip to content
Public template

About

Unity mobile game template with AI Agent Harness for Claude Code and Codex

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Unity Agent Template

English | 한국어

Unity Agent Template

A Unity mobile game template where Claude Code and Codex take a game from idea to store release and keep improving it afterwards.

What makes this different? The agents never open the Unity Editor. C# and source assets are the truth; scenes are generated by Editor scripts in batchmode. Game rules are engine-free C#, so dotnet test checks them without a Unity license. Screens are driven on the iOS Simulator with sim-use, and Codex reviews real captures on four design axes. Deployment goes Unity → Xcode → fastlane → TestFlight in one lane. The harness (agents, skills, verify gate, shared Claude/Codex setup) is ported from react-native-fsd-agent-template. The agent and skill docs are written in Korean.


Full Pipeline

"Make a game"
  Phase 0   Survey          init-app → _workspace/spec.md
  Phase 1   Ideation        idea-researcher
  Phase 2   Planning        product-planner     PRD · core loop · KPIs · module map
  Phase 2.5 Spec            spec-planner        docs/specs/ phases and tasks
  Phase 3   Design          design-architect    Theme tokens → Codex design-review
  Phase 4   Implementation  module-builder → presentation-developer → platform-integrator (quick QA after each)
  Phase 5   QA              qa-reviewer + app-inspector (simulator)
  Phase 5.5 Design QA       Codex four-axis review until GO
  Phase 6   Iteration       fix loop, max 3
  Phase 7   Deploy          /store-deploy → fastlane ios build_unity → upload
"What next?"
  Loop      Assess → Recommend → Develop → Verify → Reflect   loop-engineer (/iterate-app)

Agent Team

Agent Role
idea-researcher Mobile game market and competitor research, ideas
product-planner PRD, core loop, fun gate, KPIs, module map
spec-planner Feature specs, phase/task breakdown, progress tracking
design-architect Visual direction, Theme.cs tokens, runs the Codex design review
module-builder Domain modules (pure C# rules and simulations) with NUnit tests
presentation-developer Code-built uGUI screens, input, FX, audio, scene generator
platform-integrator Haptics, storage, store review, ads, analytics, native bridges
qa-reviewer verify, Unity compile, Hard Threshold verdict
app-inspector Simulator functional/UX inspection (sim-use, captures)
loop-engineer Post-launch recommendations and the iteration loop

Skills

Skill What it does
init-app Replace slug, name, bundle id and namespace
ideate / plan-app Ideas, PRD
design-system Palette, type and spacing tokens, layouts
design-review Simulator captures → Codex four-axis review → fix → re-review
create-module A Domain module with tests
create-screen Add a uGUI screen or state
inspect-app Full simulator inspection
orchestrate The whole pipeline
iterate-app Post-launch iteration loop
sim-use Drive simulators and emulators

Store deployment comes from the store-deploy plugin (/store-deploy), registered in .claude/settings.json.

Architecture

unity/Assets/Game/
  Domain/        Game.Domain        pure C# (noEngineReferences) — deterministic fixed step, seeded Rng, no clock
  Platform/      Game.Platform      the only place for SDKs and native bridges (Haptics sample)
  Presentation/  Game.Presentation  MonoBehaviours, code-built uGUI, Input System
  Editor/        Game.Editor        AppInfo · Build (Generate/BuildIOS/BuildAndroid) · RenderCheck
  Tests/EditMode Game.Tests.EditMode
  Content/       fonts (Noto Sans KR, OFL), icon, source assets
  Generated/     Generate output (gitignored)
unity/DomainTests~/   dotnet test project compiling the Domain and EditMode test sources

Domain and Platform reference nothing of ours; Presentation references Domain and Platform; Editor references Domain and Presentation; tests see Domain only. npm run verify checks asmdef references, Domain purity, SDK placement, safe area, version pins and files that must never be committed.

The sample game is "tap the target": GameSim moves a target at a fixed 60 Hz step and GameController builds a Title → Play → Result state machine with uGUI in code. Keep that shape when you replace it: a Domain that takes a seed and rules, a Presentation that draws it.

Getting Started

  1. Install Unity Hub + Unity 6000.3.26f1 (iOS and Android Build Support, Personal license), .NET SDK 10 (brew install dotnet), Node 20+, Xcode, fastlane and sim-use.

  2. Create a game from the template:

    gh repo create my-new-game --template seungmanchoi/unity-agent-template --private --clone
    cd my-new-game
    npm run app:init -- --slug pocket-pulse --name "Pocket Pulse"   # namespace defaults to PocketPulse
    npm run sync:codex && npm run verify
    npm run unity -- generate      # first open builds Library (a few minutes)
  3. Check it:

    npm test                       # Domain tests, no Unity license
    npm run unity -- test          # Unity EditMode tests
    npm run unity -- render        # unity/Build/render-check/*.png
    fastlane ios build_unity_sim   # simulator app → xcrun simctl install booted <app>
  4. Use the harness:

    "Make a game"                       → /orchestrate
    "Make the target speed up over time" → module-builder → presentation-developer → qa-reviewer → design-review
    "What next?"                        → /iterate-app
    

Commands

Command What it does
npm run verify check:harness + Domain dotnet test (same as the Stop hook and CI)
npm test dotnet test unity/DomainTests~
npm run unity -- generate Generate the scene, apply PlayerSettings
npm run unity -- render 1080×2340 PNG per screen state (needs a GPU)
npm run unity -- test Unity EditMode tests
npm run unity -- ios / ios-sim Xcode project (device / simulator)
npm run unity -- android / apk AAB / emulator APK
npm run app:init -- … Template → new game
npm run sync:codex .claude → Codex copies

Build & Deploy

App identity lives in unity/Assets/Game/Editor/AppInfo.cs; fastlane reads it from there.

Lane What it does
fastlane ios create_app Register the bundle id, check the ASC record (create it on the web first)
fastlane ios build_unity Latest TestFlight build + 1 → Unity BuildIOS → export-compliance plist → sigh → manual signing on Unity-iPhone → IPA
fastlane ios build_unity_sim Unsigned simulator app
fastlane ios upload Upload to TestFlight
fastlane ios tf_status / invite Processing state, invite an internal tester
fastlane android build_unity build:N AAB signed with the keystore from env vars
fastlane android internal Upload to the internal testing track

iOS signing uses the team distribution certificate already in the login keychain: never create certificates, never pass passwords on the command line. When an ads or Firebase SDK is added, EDM4U generates a workspace and build_unity builds it automatically.

Production Rules

Area Rules doc
Unity workflow (generators, layers, tests, UI baseline, pinned versions) docs/rules/unity-workflow.md
Ads — Google Mobile Ads Unity 11.5.0 (UMP → ATT → initialize) docs/rules/ads.md
Analytics · Crashlytics — Firebase Unity 13.17.0 docs/rules/analytics.md
In-app review policy engine docs/rules/store-review.md
Secure storage (PlayerPrefs vs Keychain/Keystore) docs/rules/secure-storage.md
Build and deploy docs/rules/build-deploy.md
Simulator runtime testing docs/rules/runtime-testing.md
Tooling (ponytail, CodeGraph, Codex) docs/rules/tooling.md
Troubleshooting docs/troubleshooting.md

SDKs are not bundled — platform-integrator adds them under Platform/ following these docs when a game needs them.

Branch Strategy

Game repos use main (production) ← devel (default) ← feature/*. This template repo merges into main through pull requests.

Inspired By

License

MIT. Third-party assets such as fonts follow THIRD_PARTY_ASSETS.md.

About

Unity mobile game template with AI Agent Harness for Claude Code and Codex

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages