Skip to content

hashgraph-online/awesome-codex-plugins / plugins/AUN-PN/unity-agent-workflows/skills/unity-agent-workflows

unity-agent-workflows

Verified

Use for AI-assisted Unity work that needs live repo discovery, project-derived routing, runtime-owner proof, runtime-visible output hard stops, runtime numeric proof for repeated visible-output failures, state-step guards, multi-agent scope ownership, modular C#/asmdef safety, UI/scene/visual asset gates, data-first content changes, validation, cleanup proof, or durable workflow rules. Best when agents must prove the actual folder/module/scene/prefab/runtime owner before editing, especially runtime UI, generated assets, code graphs, tutorial/state flows, guided selection/action flows, overlay/dim source-bound mistakes, coordinate conversions, focus/highlight/marker/HUD alignment, predictive lead aiming, ballistic trajectories, spatial IoU verification, or repeated "fix still not visible" failures.

references/modular-architecture.md

View on GitHub
# Modular Architecture

## Project-Derived Shape

Do not force a fixed `Core/Systems/Features` layout onto every Unity repo. First read `references/project-structure-discovery.md` and derive the user's live folders, namespaces, assemblies, scenes, prefabs, bootstraps, and content paths.

Use the repo's own structure as the target shape. If the repo already has architecture docs or `.asmdef` boundaries, those are the initial routing map unless live code proves they are stale.

## Sample Shape

This pattern is only a fallback/example for projects that already resemble it or when the user explicitly wants a migration target:

```text
Assets/Scripts
├── Core
├── Systems
│   └── <SystemName>
│       └── Contracts
└── Features
    └── <ModuleName>
```

Sample dependency direction:

```text
Core
  <- Contracts
  <- Systems
  <- Feature Modules
```

Sample rules:

- `Core` references no Systems, Features, or `Assembly-CSharp`.
- Contracts are implementation-free.
- Systems may reference Core, contracts, and lower-level acyclic systems.
- Systems must not reference Features.
- Features may reference Core, contracts, and documented implementation systems.
- Features must not reference sibling Features.
- Bootstrap/composition roots initialize through interfaces, contracts, or gateways.

## Placement Matrix

Translate this matrix into the repo's own names. For example, "feature" may be `Modules`, `Gameplay`, `Screens`, `Presentation`, or another project-local boundary.

| Change | Place | Avoid |
| --- | --- | --- |
| One module's runtime behavior | `Features/<ModuleName>` | `Core`, unrelated systems, sibling features |
| Reusable runtime service | Repo-local service/system/runtime owner path | Unrelated feature/module folders |
| Cross-feature interface/event/DTO | Repo-local contract/event/gateway boundary | Feature/module implementation folders |
| Generic primitive/utility | `Core` | Feature/system folders with runtime/content knowledge |
| Content/balance/progression data | ScriptableObject, content definition, config | Hardcoded branches inside hubs |
| Menu/lobby UI construction | Owning UI feature | Gameplay systems |
| Runtime UI/display | Owner feature/system that owns the runtime facts | Unrelated menu feature |
| App/screen/session state | State contracts plus thin owner publisher | Global polling manager |
| Analytics/telemetry | Analytics contracts/service plus shared storage | Feature-local file writer |
| Visual source asset | Asset workflow first | Procedural fallback in random code |

## Hub Stop Gate

Before closing any C# edit that adds or moves responsibility, check touched runtime owners.

Stop and split unless the user approves temporary debt when:

- A new `.cs` file is over 500 lines.
- A touched controller/manager/presenter/service is over 500 lines and the edit adds responsibility.
- A new/touched class appears as a God Node in the graph.
- A new/touched class has more than 80 graph edges.
- A controller owns multiple major responsibility groups:
  - spawn/registration/active list
  - tick/lifecycle
  - phase/state machine
  - action/ability scheduling
  - hit/damage/death resolution
  - visual creation/animation
  - resource loading/fallback art
  - UI/status text
  - audio/camera/presentation feedback
  - cross-system bridge calls

## Collaborator Choices

| Responsibility | Collaborator |
| --- | --- |
| Runtime state bucket | `<Feature>RuntimeState` |
| Action/ability timing | `<Feature>ActionScheduler` |
| Visual creation/fallback art | `<Feature>VisualFactory` / `<Feature>SpriteCatalog` |
| UI formatting | `<Feature>Formatter` / `<Feature>Presenter` |
| Spawn selection/budget | `<Feature>Spawner` / `<Feature>ActiveObjectBudget` |
| Active object list | `ActiveRuntimeSet<T>` or registry |
| Tuning numbers | profile, content definition, config, `[SerializeField]` settings |
| Cross-system call | contract, gateway, bridge, event payload |

## Asmdef Readiness

Before adding or tightening asmdefs:

- Match real `.asmdef` names and references from the repo.
- No direct sibling feature imports.
- No dependency on `Assembly-CSharp`.
- No system-to-feature reference.
- Contract assemblies have no implementation references.
- Feature modules reference only Core, contracts, and approved acyclic implementation systems.
- Unity serialized fields and `.meta` GUIDs stay stable after moves.
- Machine-readable dependency rules match real `.asmdef` files when the repo has them.

Useful check pattern:

```bash
rg -n "using .*\\.Modules\\.|ProjectName\\.Modules\\." Assets/Scripts
rg --files Assets/Scripts | rg '\\.asmdef$'
```

## Refactor Proof

A refactor is complete only when at least one proof exists:

- Removed dependency edge.
- Replaced direct module reference with contract/event/bridge/registry/service.
- Moved logic out of a hub into a focused collaborator with changed callsites.
- Reduced callsite coupling or global static reach.
- Tightened an asmdef boundary without breaking Unity serialization.
- Updated architecture docs to match actual dependency graph.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 197kUpdated Claude CodeCodexVerifiedInstall