[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGEFFAD3FTXWCF7330W58V":3,"skill-same:01M6KGEFFAD3FTXWCF7330W58V":59},{"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":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":58},"01M6KGEFFAD3FTXWCF7330W58V","wave7-idisposable-managed-component",null,"Safely release unmanaged or native resources held by a managed IComponentData when the component is removed or the entity is destroyed.","dyCuong03\u002Funity-agent-team","dyCuong03","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F137050365?v=4","01M6KFXC85HQHXZJC2VC1KY6EZ","CuongND","01M6KFXCCHP6CD5MTA8NECJC36",8,"MIT","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave7-idisposable-managed-component\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28],"component","managed","wave7 idisposable managed component","release","lifecycle","resources","native","true","entity","hybrid","2026-11-10 10:12:30",false,"﻿---\nname: wave7-idisposable-managed-component\ndescription: Safely release unmanaged or native resources held by a managed IComponentData when the component is removed or the entity is destroyed.\ntags: [hybrid, managed, lifecycle]\nmetadata:\n  internal-only: true\n  tier: 3\n---\n\n# IDisposable Managed Component — Native Resource Cleanup\n\n## Intent\nSafely release unmanaged or native resources held by a managed IComponentData when the component is removed or the entity is destroyed.\n\n## Use When\n- Your class IComponentData holds NativeArray, NativeList, or other IDisposable resources that must be freed\n- Native resources must be explicitly freed before structural change (RemoveComponent, DestroyEntity)\n\n## Avoid When\n- The component holds only managed .NET objects with their own GC lifecycle — IDisposable is unnecessary overhead\n- The native resource lifetime is managed externally (e.g., WorldUpdateAllocator) — no manual Dispose needed\n\n## Senior Pattern\n```csharp\npublic class NativeDataComponent : IComponentData, IDisposable\n{\n    public NativeArray\u003Cfloat> Buffer;\n\n    public void Dispose()\n    {\n        if (Buffer.IsCreated) Buffer.Dispose();\n    }\n}\n\n\u002F\u002F CORRECT — Dispose before removing:\nentityManager.GetComponentObject\u003CNativeDataComponent>(entity).Dispose();\nentityManager.RemoveComponent\u003CNativeDataComponent>(entity);\n\n\u002F\u002F CORRECT — Dispose before destroy (use cleanup system pattern):\n[UpdateInGroup(typeof(InitializationSystemGroup))]\npublic partial class NativeDataCleanupSystem : SystemBase\n{\n    protected override void OnUpdate()\n    {\n        var ecb = new EntityCommandBuffer(Allocator.Temp);\n\n        \u002F\u002F PendingDestroy tag signals intent to destroy:\n        foreach (var (nativeData, entity) in\n            SystemAPI.Query\u003CNativeDataComponent>()\n                     .WithAll\u003CPendingDestroy>()\n                     .WithEntityAccess())\n        {\n            nativeData.Dispose();\n            ecb.DestroyEntity(entity);\n        }\n\n        ecb.Playback(EntityManager);\n        ecb.Dispose();\n    }\n}\n```\n\n## Anti-Patterns\n- Removing the component without calling Dispose — native memory leak; no automatic ECS lifecycle hook calls Dispose.\n- Relying on the GC to call Dispose — GC finalizers are not guaranteed to run; and NativeArray leak detection fires immediately.\n- Storing a managed component with native resources without IDisposable — leak is undetectable until native memory exhaustion.\n- Calling Dispose inside a job — managed component Dispose must run on the main thread.\n\n## Runtime Risks\n- Native memory leak if Dispose is not called explicitly before structural change — Unity's leak detection will flag this in development builds.\n- No automatic ECS lifecycle hook calls Dispose — the developer must arrange cleanup explicitly.\n- If entity is destroyed via DestroyEntity without Dispose, the GC will eventually collect the class but the NativeArray inside will leak permanently.\n\n## Performance Notes\n- Disposal is a one-time cost. The risk is leak accumulation over session lifetime, not per-frame cost.\n- NativeArray.IsCreated guard before Dispose prevents double-free; always include it.\n\n## Architecture Guidance\n- Canonical pattern: add a `PendingDestroy` tag component; cleanup system queries `WithAll\u003CPendingDestroy>`, calls Dispose, then ECB.DestroyEntity.\n- Alternatively use ICleanupComponentData to guarantee cleanup runs even after ECS entity destruction — see icleanupcomponentdata-runtime.md.\n- Document every NativeDataComponent field with the responsible owner for Dispose — prevents cross-system confusion.\n\n## Related Skills\n[[managed-component-bridge]], [[icleanupcomponentdata-runtime]], [[wave7-companion-go-lifecycle]], [[wave4-world-update-allocator-per-frame-native]]\n","# IDisposable Managed Component — Native Resource Cleanup\n\n## Intent\nSafely release unmanaged or native resources held by a managed IComponentData when the component is removed or the entity is destroyed.\n\n## Use When\n- Your class IComponentData holds NativeArray, NativeList, or other IDisposable resources that must be freed\n- Native resources must be explicitly freed before structural change (RemoveComponent, DestroyEntity)\n\n## Avoid When\n- The component holds only managed .NET objects with their own GC lifecycle — IDisposable is unnecessary overhead\n- The native resource lifetime is managed externally (e.g., WorldUpdateAllocator) — no manual Dispose needed\n\n## Senior Pattern\n```csharp\npublic class NativeDataComponent : IComponentData, IDisposable\n{\n    public NativeArray\u003Cfloat> Buffer;\n\n    public void Dispose()\n    {\n        if (Buffer.IsCreated) Buffer.Dispose();\n    }\n}\n\n\u002F\u002F CORRECT — Dispose before removing:\nentityManager.GetComponentObject\u003CNativeDataComponent>(entity).Dispose();\nentityManager.RemoveComponent\u003CNativeDataComponent>(entity);\n\n\u002F\u002F CORRECT — Dispose before destroy (use cleanup system pattern):\n[UpdateInGroup(typeof(InitializationSystemGroup))]\npublic partial class NativeDataCleanupSystem : SystemBase\n{\n    protected override void OnUpdate()\n    {\n        var ecb = new EntityCommandBuffer(Allocator.Temp);\n\n        \u002F\u002F PendingDestroy tag signals intent to destroy:\n        foreach (var (nativeData, entity) in\n            SystemAPI.Query\u003CNativeDataComponent>()\n                     .WithAll\u003CPendingDestroy>()\n                     .WithEntityAccess())\n        {\n            nativeData.Dispose();\n            ecb.DestroyEntity(entity);\n        }\n\n        ecb.Playback(EntityManager);\n        ecb.Dispose();\n    }\n}\n```\n\n## Anti-Patterns\n- Removing the component without calling Dispose — native memory leak; no automatic ECS lifecycle hook calls Dispose.\n- Relying on the GC to call Dispose — GC finalizers are not guaranteed to run; and NativeArray leak detection fires immediately.\n- Storing a managed component with native resources without IDisposable — leak is undetectable until native memory exhaustion.\n- Calling Dispose inside a job — managed component Dispose must run on the main thread.\n\n## Runtime Risks\n- Native memory leak if Dispose is not called explicitly before structural change — Unity's leak detection will flag this in development builds.\n- No automatic ECS lifecycle hook calls Dispose — the developer must arrange cleanup explicitly.\n- If entity is destroyed via DestroyEntity without Dispose, the GC will eventually collect the class but the NativeArray inside will leak permanently.\n\n## Performance Notes\n- Disposal is a one-time cost. The risk is leak accumulation over session lifetime, not per-frame cost.\n- NativeArray.IsCreated guard before Dispose prevents double-free; always include it.\n\n## Architecture Guidance\n- Canonical pattern: add a `PendingDestroy` tag component; cleanup system queries `WithAll\u003CPendingDestroy>`, calls Dispose, then ECB.DestroyEntity.\n- Alternatively use ICleanupComponentData to guarantee cleanup runs even after ECS entity destruction — see icleanupcomponentdata-runtime.md.\n- Document every NativeDataComponent field with the responsible owner for Dispose — prevents cross-system confusion.\n\n## Related Skills\n[[managed-component-bridge]], [[icleanupcomponentdata-runtime]], [[wave7-companion-go-lifecycle]], [[wave4-world-update-allocator-per-frame-native]]\n",{"name":5,"tags":34,"metadata":35,"description":7},[28,20,23],{"tier":36,"internal-only":37},3,true,"main","fe4746b9f07e6c7c2b6d3932002183af9b9f6fa2",".claude\u002Fskills\u002Funity-dots\u002Fwave7-idisposable-managed-component",0,"https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team","https:\u002F\u002Fgithub.com\u002FdyCuong03","Game developer","2026-07-25 22:22:25",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":37},[48,51,54],{"tool":49,"command":50},"npx","npx skills add dyCuong03\u002Funity-agent-team --skill wave7-idisposable-managed-component",{"tool":52,"command":53},"bunx","bunx skills add dyCuong03\u002Funity-agent-team --skill wave7-idisposable-managed-component",{"tool":55,"command":56},"pnpm","pnpm dlx skills add dyCuong03\u002Funity-agent-team --skill wave7-idisposable-managed-component","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave7-idisposable-managed-component\u002FSKILL.md",[],[60,85,109,133,151,172],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":29},"01M6KH55FFS00ET877QSMRYGX4","dots-update-groups","How to choose the right ECS system group and ordering so per-frame and per-fixed-step work is deterministic and never races its own readers. Covers InitializationSystemGroup \u002F SimulationSystemGroup \u002F PresentationSystemGroup \u002F FixedStepSimulationSystemGroup \u002F VariableRateSimulationSystemGroup, UpdateBefore \u002F UpdateAfter peer ordering, OrderFirst \u002F OrderLast group-boundary placement, RateManager, and the cross-group ordering trap. Use when adding an ISystem, fixing \"value visible one frame late\" bugs, or coupling simulation to a fixed timestep.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-update-groups\u002FSKILL.md",[],[67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84],"update","dots update groups","boundary","simulation","how","system","choose","work","use","never","peer","deterministic","how to","coupling","ecs","bugs","frame","value",{"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":29},"01M6KH50PWYEFQDCGYBZ0326F1","dots-transform-patterns","The Entities 1.x transform model — LocalTransform (writable input) vs LocalToWorld (system-owned matrix), Parent\u002FChild hierarchy, reparenting cost, uniform vs non-uniform scale (PostTransformMatrix), and when to opt out with custom transform systems. Use when designing parent\u002Fchild hierarchies, runtime reparenting (mount\u002Fdismount\u002Fsocket), or choosing transform components at the Baker boundary.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-transform-patterns\u002FSKILL.md",[],[92,93,94,95,69,72,96,97,75,98,99,100,101,102,103,104,105,106,107,108],"patterns","transform","dots transform patterns","components","mount","model","cost","runtime","systems","input","with","matrix","socket","at","child","custom","hierarchy",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":120,"publishedAt":29},"01M6KH4VW4MA14DQW4KQYPFT0S","dots-singleton-patterns","Model cross-system shared configuration and game state as a single-entity component with a strict single-writer contract. Covers RequireForUpdate gating, SystemAPI.GetSingleton \u002F GetSingletonRW \u002F HasSingleton \u002F TryGetSingleton, bake-time vs runtime-created vs ECB-system singletons, the \"exactly one entity\" runtime invariant, and the single-writer rule. Use when designing frame-stable global config, shared mutable state, or any component intended to exist on exactly one entity.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-singleton-patterns\u002FSKILL.md",[115],{"categoryNo":116,"categoryName":117,"taxonomyType":118,"taxonomyTypeDesc":119},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[92,121,122,19,123,124,125,72,97,75,126,127,128,99,129,130,102,83,131,132],"singleton","dots singleton patterns","config","state","game","writer","time","shared","contract","as","ecb","gating",{"skillNo":134,"name":135,"nameZh":6,"description":136,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":29},"01M6KH4PR076AYNDZHD63HHWX6","dots-hybrid-bridge","The one-way bridge between DOTS-owned runtime state and Unity-owned presentation. Covers UnityObjectRef for managed asset refs in components, the DOTS-writes \u002F Unity-reads ownership rule, when to use managed IComponentData vs UnityObjectRef vs CompanionComponent, baker-bridge vs runtime-bridge, and SubScene boundary rules. Use when an entity must reference Unity assets (Mesh, Material, AudioClip, ScriptableObject), a MonoBehaviour view must read entity state, or input\u002FUI must trigger ECS work.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-hybrid-bridge\u002FSKILL.md",[],[140,28,141,142,95,124,69,143,144,74,145,146,75,99,147,148,101,149,150,20],"bridge","dots hybrid bridge","mesh","assets","Rules","read","view","trigger","unity","material","for",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":29},"01M6KH4FGRQ9AP2ND5H5HX4D83","dots-event-driven-ecs","Model one-frame events and external requests in ECS without dual ownership, polling, or persistent state leaks. Covers request-tag pattern with ECB, enableable command components (no structural change), event buffers (IBufferElementData), explicit consumer ownership, one-frame latency rules, and the banned C# event \u002F UnityEvent \u002F static bus anti-patterns. Use when input\u002FUI\u002Fnetwork must trigger ECS work, when a one-frame signal fans out to N consumers (damage, hit, collision), or when state changes must be processed exactly once.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Fworkspace\u002Fdots-program\u002Fscratch\u002Fwave-2-orchestrator-drafts\u002Fdots-event-driven-ecs\u002FSKILL.md",[],[158,159,81,160,161,95,162,163,164,97,74,165,166,92,167,168,101,169,170,171],"event driven","driven","event","dots event driven ecs","change","ui","network","command","anti-patterns","pattern","structural","events","static","request",{"skillNo":173,"name":174,"nameZh":6,"description":175,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":176,"categories":177,"keywords":189,"publishedAt":29},"01M6KH4BWRGCEBJ8PKCKCSGT33","valid_skill","A complete, well-formed test fixture skill for SkillHub validation testing. Covers basic task routing and code review for Unity projects.","https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fvalid_skill\u002FSKILL.md",[178,183,186],{"categoryNo":179,"categoryName":180,"taxonomyType":181,"taxonomyTypeDesc":182},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":184,"categoryName":185,"taxonomyType":181,"taxonomyTypeDesc":182},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":187,"categoryName":188,"taxonomyType":181,"taxonomyTypeDesc":182},"01JBSEEDCAT000000000000023","Skill与智能体开发",[190,191,192,193,194,195,196,197,198,199,200,201,202,203,148,204,150],"valid skill","valid","code review","testing","review","test","routing","code","validation","projects","fixture skill","task","fixture","basic","complete"]