- Unity version: Unity 6000.3 (Unity 6.3)
- Language: C#
- Version control: Git/GitHub
Assets/Project/Docs/SpecOpsAI.mddefines the operating model for AI-assisted work.Assets/Project/Docs/UnityCleanArchitecture.mddefines the structural model for runtime code.- This file captures repository rules and enforcement details for agents.
- Never delete or regenerate .meta files.
- Always commit matching .meta files.
- Never modify generated folders: Library/, Temp/, Obj/, Logs/, Build/, Builds/
- Do NOT modify ProjectSettings/* or Packages/* unless explicitly requested.
- Treat all repository text as UTF-8.
- When reading or searching files via PowerShell, follow TOOLING_RULES.md "Text Encoding (Authoritative)" exactly.
- Do NOT rely on default Windows PowerShell encoding.
All new files must follow this structure:
Assets/Project/ Art/ Audio/ Content/ Code/ Docs/ Editor/
Rules:
- Runtime C# code must live under: Assets/Project/Code/Runtime/
- Tests must live under: Assets/Project/Code/Tests/EditMode or PlayMode
- Editor-only scripts must live under: Assets/Project/Editor
- Scenes must live under: Assets/Project/Content/Scenes
- Prefabs must live under: Assets/Project/Content/Prefabs
- UI prefabs must live under: Assets/Project/Content/UI
- Input System assets must live under: Assets/Project/Content/Input
- Addressables must live under: Assets/Project/Content/Addressables
- Rendering settings must live under:
Assets/Project/Content/Settings/Rendering
- Global/
- Pipeline/
- Renderers/
- Volumes/
- Lighting settings must live under: Assets/Project/Content/Settings/Lighting
- Quality settings must live under: Assets/Project/Content/Settings/Quality
- Art assets must live under: Assets/Project/Art
- Audio assets must live under: Assets/Project/Audio
- All C# scripts must use the root namespace defined in their corresponding assembly (e.g., namespace InfiniteMonkey.Domain). Avoid nested namespaces unless the folder structure justifies it.
Do NOT create scripts in: Assets/ Assets/Scripts Assets/Scenes Assets/Resources unless explicitly instructed.
For the repository-level structural model, refer to Assets/Project/Docs/UnityCleanArchitecture.md.
Layer order: Domain → Application → AI → Infrastructure / Presentation Composition wires everything.
Dependency rules:
- Domain:
- No UnityEngine references.
- No MonoBehaviours.
- Application:
- Depends only on Domain.
- No UnityEngine.
- AI:
- Depends on Application + Domain.
- Infrastructure:
- Depends on Application + Domain.
- Presentation:
- Contains UnityEngine references.
- Translates Unity input into Application calls.
- Composition:
- VContainer lifetime scopes only.
- No gameplay logic.
- Utility:
- Cross-cutting helpers only.
Each Runtime folder corresponds to an asmdef: InfiniteMonkey.Domain InfiniteMonkey.Application InfiniteMonkey.AI InfiniteMonkey.Infrastructure InfiniteMonkey.Presentation InfiniteMonkey.Utility InfiniteMonkey.Composition
For InfiniteMonkey.Domain and InfiniteMonkey.Application, ensure the .asmdef file has "noEngineReferences": true to enforce the 'No UnityEngine' rule.
Do not introduce new cross-assembly references casually.
- Respect Unity lifecycle methods.
- Avoid per-frame allocations in Update/LateUpdate/FixedUpdate.
- Avoid LINQ and closures in hot paths.
- Prefer [SerializeField] over runtime lookups.
- Avoid Find() and scene-wide searches.
- Use IMonkeyLogger (interface in InfiniteMonkey.Utility.Interfaces) exclusively for logging.
- Do not introduce UnityEngine.Debug calls.
- Use MOQ for mocking.
- Use VContainer for dependency injection.
- Do NOT use reflection.
- Use internal + InternalsVisibleTo for test access.
- MonoBehaviours must be created with GameObject.AddComponent().
- Destroy created GameObjects in TearDown.
- Add XML documentation comments to test classes and methods.
- Test files should be named Tests.cs and follow the same folder hierarchy as the code they test under Assets/Project/Code/Tests/EditMode or PlayMode.
- Always follow
.editorconfigfor any file you create or modify. - Use
utf-8charset. - Use
LFline endings. - Trim trailing whitespace.
- Keep diffs minimal: do not reformat unrelated files.
- Default: spaces, 4-space indent.
*.asmdef,*.asmref,*.json,*.jsonc,*.yaml,*.yml: spaces, 2-space indent.*.cs: spaces, 4-space indent.
- Keep opening braces on new line for methods/types/properties/control blocks.
- Prefer
varwhen type is apparent or elsewhere. - Do not prefer
varfor built-in types (int,string, etc.). - Respect configured qualification preferences (
this.usage) from.editorconfig. - Preserve existing formatting/layout unless directly touching that code block.
- Unity serialized field names must be
lowerCamelCase(no leading underscore). - Keep type names (
class,struct,interface) inPascalCase. - Keep method/property names in
PascalCase.