agentleFS
devdavvdevdavv/unity-ai-workflow/CLAUDE.md

unity-ai-workflow

CLAUDE.md41 starsChanged 8 months agoMITView on GitHub

AI-first Unity 6.2+ game development workflow. This repo is pure infrastructure — skills, commands, docs, and templates. No Unity project inside. Copy it into your game workspace root and Claude Code reads it as its brain. Read docs/ProjectConfig.yaml at the start of every session. It contains Unity version, packages, render pipeline, UI system, architecture pattern, and dev mode. These are things LLMs consistently get wrong in Unity. Always enforced. When recommending any external tool, package, repo, tutorial, or statistic: Never…

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this CLAUDE.md into the rules it gives an agent

12 rules. About 0 are common, 3 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read docs/ProjectConfig.yaml at the start of every session.

    line 21
  2. Very specific:

    Use GameDebug wrapper (stripped from release) — never raw Debug.Log()

    line 37
  3. Very specific:

    All feature code must live inside an .asmdef

    line 40
  4. Very specific:

    Always [CreateAssetMenu] on ScriptableObjects

    line 41
  5. Very specific:

    Never: create, modify, or delete .meta files

    line 42
  6. Distinctive:

    Never call Unity API from background threads

    line 45
  7. Distinctive:

    When recommending any external tool, package, repo, tutorial, or statistic:

    line 50
  8. Distinctive:

    Never present unverified information as fact.

    line 56
  9. Very specific:

    Follow docs/CODING_STANDARDS.md, docs/NAMING_CONVENTIONS.md, and docs/GIT_CONVENTIONS.md.

    line 60
  10. Very specific:

    After a full /uw-cmd-implement-feature loop OR 3+ major decisions, offer:

    line 64
  11. Very specific:

    Use templates/SessionState_Template.md as the format.

    line 67
  12. Very specific:

    If docs/ProjectConfig.yaml → prompt_logging is true, append to docs/PromptLog.md after every response:

    line 71

≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Unity AI Workflow

AI-first Unity 6.2+ game development workflow. This repo is pure infrastructure — skills, commands, docs, and templates. No Unity project inside. Copy it into your game workspace root and Claude Code reads it as its brain.

Workspace Layout

MyGame/                        ← Open THIS folder
├── CLAUDE.md                  ← This file (auto-loaded)
├── .claude/
│   ├── commands/              ← Slash commands (/uw-cmd-implement-feature, /uw-cmd-brainstorm, etc.)
│   ├── skills/                ← Reusable knowledge modules (13 skills)
│   └── settings.json          ← Hooks & permissions
├── docs/                      ← Living project docs (GDD, TDD, GFD, ProjectConfig, standards)
├── templates/                 ← Pristine starters (GDD, GFD, TDD, PRD, Sprint, Session)
└── MyGameUnity/               ← Unity project (Assets/, Packages/, ProjectSettings/)

Project Config

Read docs/ProjectConfig.yaml at the start of every session. It contains Unity version, packages, render pipeline, UI system, architecture pattern, and dev mode.

Dev Modes

ModeBehavior
guided (default)Collaborative. Explain decisions, confirm before major changes.
autonomousAfter onboarding Q&A, proceed with minimal interruption. Only pause for destructive actions. Enable Claude Code auto mode for best results.

Non-Negotiable Rules

These are things LLMs consistently get wrong in Unity. Always enforced.

  • [SerializeField] private only — never expose fields as public for the Inspector
  • Cache ALL component references in Awake() or Start()
  • Never GetComponent<T>(), FindObjectOfType<T>(), or GameObject.Find() in Update(), FixedUpdate(), or LateUpdate()
  • Use GameDebug wrapper (stripped from release) — never raw Debug.Log()
  • New Input System only — never legacy Input.GetKey* or Input.GetAxis*
  • Awaitable for async (Unity 6 native) — check ProjectConfig for overrides
  • All feature code must live inside an .asmdef
  • Always [CreateAssetMenu] on ScriptableObjects
  • Never create, modify, or delete .meta files
  • UI Toolkit recommended — check ProjectConfig.yaml → ui_system for override (UGUI/Mixed valid)
  • Visual Scripting forbidden for logic — Shader Graph & VFX Graph are fine
  • Never call Unity API from background threads
  • /// <summary> only on public API methods that warrant explanation — never on classes

Verification Marking

When recommending any external tool, package, repo, tutorial, or statistic:

  • [VERIFIED: source] — accessed/confirmed this session
  • [SYNTHESIZED: source] — AI-researched, not primary source
  • [UNVERIFIED: training data] — needs web search to verify

Never present unverified information as fact.

Coding Standards

Follow docs/CODING_STANDARDS.md, docs/NAMING_CONVENTIONS.md, and docs/GIT_CONVENTIONS.md.

Session Hygiene

After a full /uw-cmd-implement-feature loop OR 3+ major decisions, offer:

"This session is getting long. Want me to write a SessionState summary you can paste into a fresh conversation?"

Use templates/SessionState_Template.md as the format.

Prompt Logging

If docs/ProjectConfig.yaml → prompt_logging is true, append to docs/PromptLog.md after every response:

## [YYYY-MM-DD HH:MM] — <Workflow or Task Type>
**Prompt:** <user's exact words>
**Summary:** <≤200 word factual summary>
---

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.