Index of every page on this site: llms.txt
All skills
wshobson avatar

/unity-ecs-patterns

@4220308
by Seth Hobsonwshobson/agents43k stars
4,518
Run it yourself

Master Unity ECS (Entity Component System) with DOTS, Jobs, and Burst for high-performance game development. Use when building data-oriented games, optimizing performance, or working with large entity counts.

  • 2 files
  • 16.2 KB
  • Updated 6 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/wshobson/agents/unity-ecs-patterns

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈57 tokens for metadata: the name and description. ≈453 when used: this file. ≈3.6k more on demand in 1 file.

Description uses 2.9% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈229 characters, or 2.9%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

Do's

  • Use ISystem over SystemBase - Better performance
  • Burst compile everything - Massive speedup
  • Batch structural changes - Use ECB
  • Profile with Profiler - Identify bottlenecks
  • Use Aspects - Clean component grouping

Don'ts

  • Don't use managed types - Breaks Burst
  • Don't structural change in jobs - Use ECB
  • Don't over-architect - Start simple
  • Don't ignore chunk utilization - Group similar entities
  • Don't forget disposal - Native collections leak

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 4220308. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 6 months ago
  • Performance
  • unity
  • ecs
  • dots
  • job-system
  • burst
  • game-development
  • data-oriented

README badge

README badge for wshobson/agents/unity-ecs-patterns

Provides production patterns for Unity's Entity Component System (ECS) within DOTS, covering the Job System and Burst Compiler for data-oriented game architecture. Use when building high-performance games with large entity counts or converting object-oriented game code to ECS patterns.

Generated from the current SKILL.md.

Does this skill cover Unity's modern ECS (DOTS) or the older ECS package?
The skill focuses on production patterns for Unity's Data-Oriented Technology Stack (DOTS), which includes the modern Entity Component System, Job System, and Burst Compiler.
Can I use managed types and C# objects with these patterns?
No. The skill emphasizes that managed types break Burst compilation, so patterns are built around pure data components and native collections only.
Does this skill help convert existing OOP game code to ECS?
Yes. The skill explicitly covers converting OOP game code to ECS and includes patterns for managing the architectural transition.
What should I use instead of SystemBase?
The skill recommends ISystem over SystemBase for better performance in production code.
Does this cover structural changes during job execution?
Yes. The skill advises against structural changes in jobs and instead recommends using Entity Command Buffers (ECB) to batch changes safely.

Generated from the current SKILL.md. These answers refresh after source changes.