[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CS4J0DDX2YZ84Z525PZ8S6":3,"skill-same:01M7CS4J0DDX2YZ84Z525PZ8S6":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7CS4J0DDX2YZ84Z525PZ8S6","unity-dots-ecs",null,"Use when working in a Unity project that uses Entities (DOTS) or when a task needs thousands of simulated objects - when ECS is worth it, components\u002Fbakers\u002FISystem with IJobEntity and Burst, entity command buffers for structural changes, native memory rules, and testing systems in a test World.","makifbaysal\u002Ftasktrooper","makifbaysal","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F25031940?v=4","01M7CRG3ZCSYZSSEVDMW3DEYC8","Mehmet Akif Baysal","01M7CRG401FJ8YAXH5ER730XYV",122,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fgame-developer\u002Fskills\u002Funity-dots-ecs\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: unity-dots-ecs\ncategory: architecture\ndescription: Use when working in a Unity project that uses Entities (DOTS) or when a task needs thousands of simulated objects - when ECS is worth it, components\u002Fbakers\u002FISystem with IJobEntity and Burst, entity command buffers for structural changes, native memory rules, and testing systems in a test World.\ntech_stack: Unity\nsource: wshobson\u002Fagents unity-ecs-patterns (MIT), adapted; Unity Entities 1.x docs cited\n---\n# Unity DOTS \u002F ECS\n\n## Overview\n\nUnity's Entities package stores data in tightly packed chunks and runs Burst-compiled jobs over it in parallel. It scales to tens of thousands of entities where GameObjects choke — and it makes simple gameplay code more verbose. Use it where the scale needs it, follow the project's existing split between GameObjects and entities, and never introduce DOTS into a GameObject project on your own initiative.\n\n**Core principle:** Components are plain data, systems are Burst-compiled `ISystem`s scheduling jobs, and structural changes go through an entity command buffer.\n\n## When it is worth it\n\n| Situation | Use |\n|---|---|\n| Thousands of similar units, projectiles, boids, crowd agents | ECS (or Jobs + Burst over native arrays first) |\n| Heavy simulation with little per-object uniqueness | ECS |\n| UI, menus, a handful of characters, bespoke scripted moments | GameObjects |\n| Mixed game | Hybrid: entities for the swarm, GameObjects for the player, UI and cameras |\n\n## The pieces\n\n```csharp\n\u002F\u002F Data: unmanaged structs\npublic struct Speed : IComponentData { public float Value; }\npublic struct Target : IComponentData { public float3 Position; }\n\n\u002F\u002F Authoring + baking: designers edit a MonoBehaviour in a subscene; the baker turns it into components\npublic sealed class SpeedAuthoring : MonoBehaviour {\n    public float value = 5f;\n    sealed class Baker : Baker\u003CSpeedAuthoring> {\n        public override void Bake(SpeedAuthoring a) {\n            var e = GetEntity(TransformUsageFlags.Dynamic);\n            AddComponent(e, new Speed { Value = a.value });\n        }\n    }\n}\n\n\u002F\u002F Behaviour: a Burst-compiled ISystem scheduling a parallel IJobEntity\n[BurstCompile]\npublic partial struct SeekSystem : ISystem {\n    [BurstCompile] public void OnCreate(ref SystemState state) => state.RequireForUpdate\u003CSpeed>();\n\n    [BurstCompile] public void OnUpdate(ref SystemState state) {\n        new SeekJob { Dt = SystemAPI.Time.DeltaTime }.ScheduleParallel();\n    }\n}\n\n[BurstCompile]\npartial struct SeekJob : IJobEntity {\n    public float Dt;\n    void Execute(ref LocalTransform transform, in Speed speed, in Target target) {\n        var to = target.Position - transform.Position;\n        var dist = math.length(to);\n        if (dist > 0.01f) transform.Position += to \u002F dist * math.min(speed.Value * Dt, dist);\n    }\n}\n```\n\n## Rules\n\n- **`ISystem` with `[BurstCompile]`** over `SystemBase` for new systems; `SystemBase` only where managed objects are unavoidable.\n- **Burst everything on the hot path:** no managed types (classes, strings, `List\u003CT>`) in components or jobs that should be Burst-compiled; use `FixedString`, `NativeArray`, `DynamicBuffer`.\n- **`in` for read-only, `ref` for written** components in `Execute` — it drives the dependency system and parallelism.\n- **Structural changes** (create\u002Fdestroy entities, add\u002Fremove components) are recorded in an entity command buffer, not done inside jobs:\n\n```csharp\nvar ecb = SystemAPI.GetSingleton\u003CEndSimulationEntityCommandBufferSystem.Singleton>()\n                   .CreateCommandBuffer(state.WorldUnmanaged).AsParallelWriter();\nnew ExpireJob { Ecb = ecb, Now = (float)SystemAPI.Time.ElapsedTime }.ScheduleParallel();\n\u002F\u002F in the job: void Execute([ChunkIndexInQuery] int key, Entity e, in Lifetime l) { if (Now > l.EndsAt) Ecb.DestroyEntity(key, e); }\n```\n\n- **Frequent on\u002Foff states** use enableable components (`IEnableableComponent`) instead of add\u002Fremove, which moves the entity between chunks.\n- **Archetype hygiene:** many tiny component combinations fragment chunks; check chunk utilisation in the Entities windows.\n- **Native memory:** every `NativeArray`\u002F`NativeList` is disposed — `Allocator.Temp` inside a frame, `TempJob` within four frames, `Persistent` in `OnDestroy`. Leak warnings are bugs.\n- **Aspects** (`IAspect`) are deprecated in recent Entities releases — use explicit component parameters and queries instead of adding new ones.\n- Physics (Unity Physics \u002F Havok) runs in its own fixed-step group — gameplay that reacts to physics runs in or after that group, not in an arbitrary `Update` system.\n\n## Testing systems\n\n```csharp\npublic class SeekSystemTests {\n    World _world; EntityManager _em;\n\n    [SetUp] public void SetUp() { _world = new World(\"Test\"); _em = _world.EntityManager; }\n    [TearDown] public void TearDown() => _world.Dispose();\n\n    [Test] public void Update_EntityWithSpeed_MovesTowardTarget() {\n        var e = _em.CreateEntity(typeof(LocalTransform), typeof(Speed), typeof(Target));\n        _em.SetComponentData(e, LocalTransform.FromPosition(float3.zero));\n        _em.SetComponentData(e, new Speed { Value = 2f });\n        _em.SetComponentData(e, new Target { Position = new float3(10, 0, 0) });\n        var system = _world.CreateSystem\u003CSeekSystem>();\n\n        _world.SetTime(new TimeData(elapsedTime: 0.5, deltaTime: 0.5f));\n        system.Update(_world.Unmanaged);\n        _em.CompleteAllTrackedJobs();\n\n        Assert.That(_em.GetComponentData\u003CLocalTransform>(e).Position.x, Is.EqualTo(1f).Within(1e-4));\n    }\n}\n```\n\n- A fresh `World` per test, disposed in teardown; create only the systems under test.\n- Complete jobs before asserting.\n- Keep the math in static Burst-compatible functions so it can also be tested as a plain function.\n\n## Netcode for Entities (if the project uses it)\n\nGhost components replicate state; prediction runs in the predicted simulation group; input travels as `IInputComponentData`. Server-authority rules from game-networking still apply — validate input on the server world.\n\n## Common Mistakes\n\n- Converting a small game to ECS for \"performance\" with no profiler evidence.\n- Structural changes inside a job, or `EntityManager` calls in a hot loop on the main thread.\n- Managed components in a system that is supposed to be Burst-compiled; Burst silently falls back or errors.\n- Forgetting `RequireForUpdate`, so a system runs (and throws) before its data exists.\n\n## Red Flags\n\n- `SystemBase` + `Entities.ForEach` in new code (legacy API).\n- Native containers without a matching `Dispose`.\n- A system that reads and writes the same component from two jobs without dependencies.\n","# Unity DOTS \u002F ECS\n\n## Overview\n\nUnity's Entities package stores data in tightly packed chunks and runs Burst-compiled jobs over it in parallel. It scales to tens of thousands of entities where GameObjects choke — and it makes simple gameplay code more verbose. Use it where the scale needs it, follow the project's existing split between GameObjects and entities, and never introduce DOTS into a GameObject project on your own initiative.\n\n**Core principle:** Components are plain data, systems are Burst-compiled `ISystem`s scheduling jobs, and structural changes go through an entity command buffer.\n\n## When it is worth it\n\n| Situation | Use |\n|---|---|\n| Thousands of similar units, projectiles, boids, crowd agents | ECS (or Jobs + Burst over native arrays first) |\n| Heavy simulation with little per-object uniqueness | ECS |\n| UI, menus, a handful of characters, bespoke scripted moments | GameObjects |\n| Mixed game | Hybrid: entities for the swarm, GameObjects for the player, UI and cameras |\n\n## The pieces\n\n```csharp\n\u002F\u002F Data: unmanaged structs\npublic struct Speed : IComponentData { public float Value; }\npublic struct Target : IComponentData { public float3 Position; }\n\n\u002F\u002F Authoring + baking: designers edit a MonoBehaviour in a subscene; the baker turns it into components\npublic sealed class SpeedAuthoring : MonoBehaviour {\n    public float value = 5f;\n    sealed class Baker : Baker\u003CSpeedAuthoring> {\n        public override void Bake(SpeedAuthoring a) {\n            var e = GetEntity(TransformUsageFlags.Dynamic);\n            AddComponent(e, new Speed { Value = a.value });\n        }\n    }\n}\n\n\u002F\u002F Behaviour: a Burst-compiled ISystem scheduling a parallel IJobEntity\n[BurstCompile]\npublic partial struct SeekSystem : ISystem {\n    [BurstCompile] public void OnCreate(ref SystemState state) => state.RequireForUpdate\u003CSpeed>();\n\n    [BurstCompile] public void OnUpdate(ref SystemState state) {\n        new SeekJob { Dt = SystemAPI.Time.DeltaTime }.ScheduleParallel();\n    }\n}\n\n[BurstCompile]\npartial struct SeekJob : IJobEntity {\n    public float Dt;\n    void Execute(ref LocalTransform transform, in Speed speed, in Target target) {\n        var to = target.Position - transform.Position;\n        var dist = math.length(to);\n        if (dist > 0.01f) transform.Position += to \u002F dist * math.min(speed.Value * Dt, dist);\n    }\n}\n```\n\n## Rules\n\n- **`ISystem` with `[BurstCompile]`** over `SystemBase` for new systems; `SystemBase` only where managed objects are unavoidable.\n- **Burst everything on the hot path:** no managed types (classes, strings, `List\u003CT>`) in components or jobs that should be Burst-compiled; use `FixedString`, `NativeArray`, `DynamicBuffer`.\n- **`in` for read-only, `ref` for written** components in `Execute` — it drives the dependency system and parallelism.\n- **Structural changes** (create\u002Fdestroy entities, add\u002Fremove components) are recorded in an entity command buffer, not done inside jobs:\n\n```csharp\nvar ecb = SystemAPI.GetSingleton\u003CEndSimulationEntityCommandBufferSystem.Singleton>()\n                   .CreateCommandBuffer(state.WorldUnmanaged).AsParallelWriter();\nnew ExpireJob { Ecb = ecb, Now = (float)SystemAPI.Time.ElapsedTime }.ScheduleParallel();\n\u002F\u002F in the job: void Execute([ChunkIndexInQuery] int key, Entity e, in Lifetime l) { if (Now > l.EndsAt) Ecb.DestroyEntity(key, e); }\n```\n\n- **Frequent on\u002Foff states** use enableable components (`IEnableableComponent`) instead of add\u002Fremove, which moves the entity between chunks.\n- **Archetype hygiene:** many tiny component combinations fragment chunks; check chunk utilisation in the Entities windows.\n- **Native memory:** every `NativeArray`\u002F`NativeList` is disposed — `Allocator.Temp` inside a frame, `TempJob` within four frames, `Persistent` in `OnDestroy`. Leak warnings are bugs.\n- **Aspects** (`IAspect`) are deprecated in recent Entities releases — use explicit component parameters and queries instead of adding new ones.\n- Physics (Unity Physics \u002F Havok) runs in its own fixed-step group — gameplay that reacts to physics runs in or after that group, not in an arbitrary `Update` system.\n\n## Testing systems\n\n```csharp\npublic class SeekSystemTests {\n    World _world; EntityManager _em;\n\n    [SetUp] public void SetUp() { _world = new World(\"Test\"); _em = _world.EntityManager; }\n    [TearDown] public void TearDown() => _world.Dispose();\n\n    [Test] public void Update_EntityWithSpeed_MovesTowardTarget() {\n        var e = _em.CreateEntity(typeof(LocalTransform), typeof(Speed), typeof(Target));\n        _em.SetComponentData(e, LocalTransform.FromPosition(float3.zero));\n        _em.SetComponentData(e, new Speed { Value = 2f });\n        _em.SetComponentData(e, new Target { Position = new float3(10, 0, 0) });\n        var system = _world.CreateSystem\u003CSeekSystem>();\n\n        _world.SetTime(new TimeData(elapsedTime: 0.5, deltaTime: 0.5f));\n        system.Update(_world.Unmanaged);\n        _em.CompleteAllTrackedJobs();\n\n        Assert.That(_em.GetComponentData\u003CLocalTransform>(e).Position.x, Is.EqualTo(1f).Within(1e-4));\n    }\n}\n```\n\n- A fresh `World` per test, disposed in teardown; create only the systems under test.\n- Complete jobs before asserting.\n- Keep the math in static Burst-compatible functions so it can also be tested as a plain function.\n\n## Netcode for Entities (if the project uses it)\n\nGhost components replicate state; prediction runs in the predicted simulation group; input travels as `IInputComponentData`. Server-authority rules from game-networking still apply — validate input on the server world.\n\n## Common Mistakes\n\n- Converting a small game to ECS for \"performance\" with no profiler evidence.\n- Structural changes inside a job, or `EntityManager` calls in a hot loop on the main thread.\n- Managed components in a system that is supposed to be Burst-compiled; Burst silently falls back or errors.\n- Forgetting `RequireForUpdate`, so a system runs (and throws) before its data exists.\n\n## Red Flags\n\n- `SystemBase` + `Entities.ForEach` in new code (legacy API).\n- Native containers without a matching `Dispose`.\n- A system that reads and writes the same component from two jobs without dependencies.\n",{"name":5,"source":24,"category":25,"tech_stack":26,"description":7},"wshobson\u002Fagents unity-ecs-patterns (MIT), adapted; Unity Entities 1.x docs cited","architecture","Unity","main","910394a0b6db9fc8c9a8f36328ec421d3ebd8b38","catalog\u002Fagents\u002Fgame-developer\u002Fskills\u002Funity-dots-ecs",18,"https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper","https:\u002F\u002Ftasktrooper.ai","https:\u002F\u002Fgithub.com\u002Fmakifbaysal","Senior Software Developer","2026-11-15 04:50:29",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add makifbaysal\u002Ftasktrooper --skill unity-dots-ecs",{"tool":42,"command":43},"bunx","bunx skills add makifbaysal\u002Ftasktrooper --skill unity-dots-ecs",{"tool":45,"command":46},"pnpm","pnpm dlx skills add makifbaysal\u002Ftasktrooper --skill unity-dots-ecs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fgame-developer\u002Fskills\u002Funity-dots-ecs\u002FSKILL.md",true,[],[51,57,64,71,78,85],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7CSVEPQW6J6TD6CS2T5FPNZ","visual-craft","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fvisual-craft\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7CSVAQG91ETHQ0HBNZDG5FR","ux-copy","Use when you write any words a user reads in a mockup or a hand-off - content language and voice, buttons, labels, errors, empty states, confirmations, numbers and dates, and the longest-string check","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fux-copy\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CSV6H0J38659NDXHJQ8396","screen-mockup-html","Use when you draw screens as the design task's HTML mockup - ONE canvas document holding every screen and every variant side by side, the sanitizer-safe recipe, phone and wide frames, the states grid, static control states, and the loopback self-check with screenshots at 375, 768 and 1440 attached to the task","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fscreen-mockup-html\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M7CSV3JFRF3BM3XK52M7YEYR","performance-awareness","How the performance score moves for your role. Use when the score context shows a declining trend, or before handing off work you have not self-checked against every criterion.","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fperformance-awareness\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M7CSTZDH00YRF5SCT7BRT9QD","design-variants","Use when a screen design needs variants - how many, variants as side-by-side rows on the one canvas, what makes two variants genuinely different, recommending one, how the human's choice is read, and narrowing to the chosen one in revision","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-variants\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M7CSTV6P3SM3PAE28DB0RF77","design-system-authoring","Use when you derive, change or extend a design system - where tokens live per stack, the DTCG token tree, role-based names for both themes, base vs layer vs drift, the DESIGN.md section order, the inventory format, the contrast check and the lint every proposal returns","https:\u002F\u002Fgithub.com\u002Fmakifbaysal\u002Ftasktrooper\u002Fblob\u002Fmain\u002Fcatalog\u002Fagents\u002Fui-designer\u002Fskills\u002Fdesign-system-authoring\u002FSKILL.md",[],[]]