unity-ecs-patterns

unity-ecs-patterns is a skill for Claude Code from EngineerWithAI/engineerwith-agents. It costs 45 tokens per session (3,622 once invoked), scanned A, original, MIT.

A guide to Unity’s Entity Component System, a way to organize game data and logic for processing many objects efficiently. It covers Unity DOTS, jobs, and Burst for data-oriented game development.

In plain words
What is it for?
Use it to build data-oriented game systems, manage large entity counts, parallelize CPU work, and optimize performance-heavy gameplay.
Why use it?
It helps when traditional object-based game code becomes difficult to scale or too slow for large numbers of entities.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the game-development plugin — 2 skills shipped together

Good fit Use it to build data-oriented game systems, manage large entity counts, parallelize CPU work, and optimize performance-heavy gameplay.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/engineerwithai/engineerwith-agents/unity-ecs-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add EngineerWithAI/engineerwith-agents --skill unity-ecs-patterns
Clone the repo
git clone --depth 1 https://github.com/EngineerWithAI/engineerwith-agents

Made for: Claude Code.

Or install game-development, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unity-ecs-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/unity-ecs-patterns/github.svg)](https://agentmods.dev/skills/engineerwithai/engineerwith-agents/unity-ecs-patterns)
Your own site
<a href="https://agentmods.dev/skills/engineerwithai/engineerwith-agents/unity-ecs-patterns"><img src="https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/unity-ecs-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unity-ecs-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/engineerwithai/engineerwith-agents/unity-ecs-patterns"><img src="https://agentmods.dev/badge/skills/engineerwithai/engineerwith-agents/unity-ecs-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,622 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.03622
Opus 5 $0.00023 $0.01811
Sonnet 5 $0.00009 $0.00724
Haiku 4.5 $0.00005 $0.00362

Measured 6d ago against content hash 07905bb9560c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

unity-ecs-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

plugins/game-development/skills/unity-ecs-patterns/SKILL.md · 627 lines

How it starts

The opening of the file, as written. The whole thing — 627 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Unity ECS Patterns

Production patterns for Unity's Data-Oriented Technology Stack (DOTS) including Entity Component System, Job System, and Burst Compiler.

When to Use This Skill

  • Building high-performance Unity games
  • Managing thousands of entities efficiently
  • Implementing data-oriented game systems
  • Optimizing CPU-bound game logic
  • Converting OOP game code to ECS
  • Using Jobs and Burst for parallelization

Core Concepts

1. ECS vs OOP

Aspect Traditional OOP ECS/DOTS
Data layout Object-oriented Data-oriented
Memory Scattered Contiguous
Processing Per-object Batched
Scaling Poor with count Linear scaling
Best for Complex behaviors Mass simulation

2. DOTS Components

Entity: Lightweight ID (no data)
Component: Pure data (no behavior)
System: Logic that processes components
World: Container for entities
Archetype: Unique combination of components
Chunk: Memory block for same-archetype entities

Patterns

Pattern 1: Basic ECS Setup

using Unity.Entities;
using Unity.Mathematics;
using Unity.Transforms;
using Unity.Burst;
using Unity.Collections;

// Component: Pure data, no methods
public struct Speed : IComponentData
{
    public float Value;
}

public struct Health : IComponentData
{
    public float Current;
    public float Max;
}

public struct Target : IComponentData
{
    public Entity Value;
}

// Tag component (zero-size marker)
public struct EnemyTag : IComponentData { }
public struct PlayerTag : IComponentData { }

// Buffer component (variable-size array)
[InternalBufferCapacity(8)]
public struct InventoryItem : IBufferElementData
{
    public int ItemId;
    public int Quantity;
}

// Shared component (grouped entities)
public struct TeamId : ISharedComponentData
{
    public int Value;
}

Pattern 2: Systems with ISystem (Recommended)

using Unity.Entities;
using Unity.Transforms;
using Unity.Mathematics;
using Unity.Burst;

// ISystem: Unmanaged, Burst-compatible, highest performance
[BurstCompile]
public partial struct MovementSystem : ISystem
{
    [BurstCompile]
    public void OnCreate(ref SystemState state)
    {
        // Require components before system runs
        state.RequireForUpdate<Speed>();
    }

    [BurstCompile]
    public void OnUpdate(ref SystemState state)
    {
        float deltaTime = SystemAPI.Time.DeltaTime;

        // Simple foreach - auto-generates job
        foreach (var (transform, speed) in
            SystemAPI.Query<RefRW<LocalTransform>, RefRO<Speed>>())
        {
            transform.ValueRW.Position +=
                new float3(0, 0, speed.ValueRO.Value * deltaTime);
        }
    }

    [BurstCompile]
    public void OnDestroy(ref SystemState state) { }
}

// With explicit job for more control
[BurstCompile]
public partial struct MovementJobSystem : ISystem
{
    [BurstCompile]
    public void OnUpdate(ref SystemState state)
    {
        var job = new MoveJob
        {
            DeltaTime = SystemAPI.Time.DeltaTime
        };

        state.Dependency = job.ScheduleParallel(state.Dependency);
    }
}

[BurstCompile]
public partial struct MoveJob : IJobEntity
{
    public float DeltaTime;

    void Execute(ref LocalTransform transform, in Speed speed)
    {
        transform.Position += new float3(0, 0, speed.Value * DeltaTime);
    }
}

Read the full file on GitHub · 627 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 627 lines · 45 tokens per session scan A 07905bb9560c

Subscribe to this mod's changes

unity-ecs-patterns is a skill published in the GitHub repository EngineerWithAI/engineerwith-agents (4 stars, last pushed 8mo ago), licensed MIT. It adds 45 tokens to every session and 3,622 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.