[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGFR3MFT3456F97XK1D2BZ":3,"skill-same:01M6KGFR3MFT3456F97XK1D2BZ":61},{"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":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":46,"updatedAt":47,"install":48,"resources":60},"01M6KGFR3MFT3456F97XK1D2BZ","wave8-dynamic-buffer-invalidation",null,"Prevent unsafe access to DynamicBuffer references after structural changes have invalidated the underlying chunk memory pointer.","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\u002Fwave8-dynamic-buffer-invalidation\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"buffer","wave8 dynamic buffer invalidation","memory","debug","chunk","access","references","structural","true","changes","unsafe","antipattern","2026-11-10 10:12:30",false,"﻿---\nname: wave8-dynamic-buffer-invalidation\ndescription: Prevent unsafe access to DynamicBuffer references after structural changes have invalidated the underlying chunk memory pointer.\ntags: [antipattern, debug]\nmetadata:\n  internal-only: true\n  tier: 3\n---\n\n# DynamicBuffer Invalidation After Structural Changes\n\n## Intent\nPrevent unsafe access to DynamicBuffer references after structural changes have invalidated the underlying chunk memory pointer.\n\n## Use When\n- Any system reads a DynamicBuffer reference and then performs structural changes (AddComponent, RemoveComponent, DestroyEntity, CreateEntity) on any entity in the same frame\n\n## Avoid When\n- No structural changes occur in the system — buffer references are stable within a single structural-change-free frame\n\n## Senior Pattern\n```csharp\n\u002F\u002F WRONG — structural change invalidates the buffer reference:\nvar buffer = SystemAPI.GetBuffer\u003CWaypointElement>(entity);\nEntityManager.AddComponent\u003CDeadTag>(entity);   \u002F\u002F structural change — buffer pointer now invalid\nvar count = buffer.Length;                      \u002F\u002F undefined behavior, potential crash\n\n\u002F\u002F CORRECT — read buffer contents before structural change:\nvar buffer = SystemAPI.GetBuffer\u003CWaypointElement>(entity);\nvar waypointCount = buffer.Length;             \u002F\u002F read before structural change\nvar lastWaypoint = waypointCount > 0 ? buffer[waypointCount - 1] : default;\n\n\u002F\u002F Then defer structural change via ECB:\nvar ecb = new EntityCommandBuffer(Allocator.Temp);\necb.AddComponent\u003CDeadTag>(entity);             \u002F\u002F deferred — buffer still valid until Playback\necb.Playback(EntityManager);\necb.Dispose();\n\u002F\u002F After Playback: buffer reference is invalid — do not access\n\n\u002F\u002F CORRECT alternative — re-fetch after structural change:\nEntityManager.AddComponent\u003CDeadTag>(entity);                      \u002F\u002F structural change\nvar freshBuffer = SystemAPI.GetBuffer\u003CWaypointElement>(entity);   \u002F\u002F re-fetch\n```\n\n## Anti-Patterns\n- Storing a DynamicBuffer reference in a field and reading it across system updates — invalid after any structural change.\n- Calling EntityManager.GetBuffer\u003CT> and then EntityManager.AddComponent in the same method without re-fetching — pointer invalidation.\n- Caching buffer references in NativeArray fields between frames — never valid across structural changes.\n- Reading a buffer reference after ECB.Playback in the same method — Playback is a structural change; the reference is invalid after it.\n\n## Runtime Risks\n- Access to invalidated buffer memory causes silent data corruption or NullReferenceException.\n- The safety system catches this in editor builds (throws InvalidOperationException) but may silently corrupt in release builds — do not rely on editor-only detection.\n\n## Performance Notes\n- Re-fetching a buffer is cheap (O(1) archetype lookup). The cost of getting it wrong is a crash or corruption.\n- Always prefer ECB to defer structural changes and keep buffer references valid for the current frame's read pass.\n\n## Architecture Guidance\n- Treat DynamicBuffer references as frame-scoped and structural-change-scoped.\n- Separate read passes from structural change passes within a system's OnUpdate.\n- Use ECB to push structural changes after all reads complete.\n- If both read and structural change are required in the same method, re-fetch the buffer after the structural change.\n\n## Related Skills\n[[entity-command-buffer]], [[ecb-system-timing]], [[toentityarray-snapshot-pattern]], [[structural-change-cost-model]]\n","# DynamicBuffer Invalidation After Structural Changes\n\n## Intent\nPrevent unsafe access to DynamicBuffer references after structural changes have invalidated the underlying chunk memory pointer.\n\n## Use When\n- Any system reads a DynamicBuffer reference and then performs structural changes (AddComponent, RemoveComponent, DestroyEntity, CreateEntity) on any entity in the same frame\n\n## Avoid When\n- No structural changes occur in the system — buffer references are stable within a single structural-change-free frame\n\n## Senior Pattern\n```csharp\n\u002F\u002F WRONG — structural change invalidates the buffer reference:\nvar buffer = SystemAPI.GetBuffer\u003CWaypointElement>(entity);\nEntityManager.AddComponent\u003CDeadTag>(entity);   \u002F\u002F structural change — buffer pointer now invalid\nvar count = buffer.Length;                      \u002F\u002F undefined behavior, potential crash\n\n\u002F\u002F CORRECT — read buffer contents before structural change:\nvar buffer = SystemAPI.GetBuffer\u003CWaypointElement>(entity);\nvar waypointCount = buffer.Length;             \u002F\u002F read before structural change\nvar lastWaypoint = waypointCount > 0 ? buffer[waypointCount - 1] : default;\n\n\u002F\u002F Then defer structural change via ECB:\nvar ecb = new EntityCommandBuffer(Allocator.Temp);\necb.AddComponent\u003CDeadTag>(entity);             \u002F\u002F deferred — buffer still valid until Playback\necb.Playback(EntityManager);\necb.Dispose();\n\u002F\u002F After Playback: buffer reference is invalid — do not access\n\n\u002F\u002F CORRECT alternative — re-fetch after structural change:\nEntityManager.AddComponent\u003CDeadTag>(entity);                      \u002F\u002F structural change\nvar freshBuffer = SystemAPI.GetBuffer\u003CWaypointElement>(entity);   \u002F\u002F re-fetch\n```\n\n## Anti-Patterns\n- Storing a DynamicBuffer reference in a field and reading it across system updates — invalid after any structural change.\n- Calling EntityManager.GetBuffer\u003CT> and then EntityManager.AddComponent in the same method without re-fetching — pointer invalidation.\n- Caching buffer references in NativeArray fields between frames — never valid across structural changes.\n- Reading a buffer reference after ECB.Playback in the same method — Playback is a structural change; the reference is invalid after it.\n\n## Runtime Risks\n- Access to invalidated buffer memory causes silent data corruption or NullReferenceException.\n- The safety system catches this in editor builds (throws InvalidOperationException) but may silently corrupt in release builds — do not rely on editor-only detection.\n\n## Performance Notes\n- Re-fetching a buffer is cheap (O(1) archetype lookup). The cost of getting it wrong is a crash or corruption.\n- Always prefer ECB to defer structural changes and keep buffer references valid for the current frame's read pass.\n\n## Architecture Guidance\n- Treat DynamicBuffer references as frame-scoped and structural-change-scoped.\n- Separate read passes from structural change passes within a system's OnUpdate.\n- Use ECB to push structural changes after all reads complete.\n- If both read and structural change are required in the same method, re-fetch the buffer after the structural change.\n\n## Related Skills\n[[entity-command-buffer]], [[ecb-system-timing]], [[toentityarray-snapshot-pattern]], [[structural-change-cost-model]]\n",{"name":5,"tags":36,"metadata":37,"description":7},[30,22],{"tier":38,"internal-only":39},3,true,"main","fe4746b9f07e6c7c2b6d3932002183af9b9f6fa2",".claude\u002Fskills\u002Funity-dots\u002Fwave8-dynamic-buffer-invalidation",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":49,"prompt":59,"zipAvailable":39},[50,53,56],{"tool":51,"command":52},"npx","npx skills add dyCuong03\u002Funity-agent-team --skill wave8-dynamic-buffer-invalidation",{"tool":54,"command":55},"bunx","bunx skills add dyCuong03\u002Funity-agent-team --skill wave8-dynamic-buffer-invalidation",{"tool":57,"command":58},"pnpm","pnpm dlx skills add dyCuong03\u002Funity-agent-team --skill wave8-dynamic-buffer-invalidation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave8-dynamic-buffer-invalidation\u002FSKILL.md",[],[62,87,111,131,151,171],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":31},"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",[],[69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86],"update","dots update groups","boundary","simulation","how","system","choose","work","use","never","peer","deterministic","how to","coupling","ecs","bugs","frame","value",{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":31},"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",[],[94,95,96,97,71,74,98,99,77,100,101,102,103,104,105,106,107,108,109,110],"patterns","transform","dots transform patterns","components","mount","model","cost","runtime","systems","input","with","matrix","socket","at","child","custom","hierarchy",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":31},"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",[],[94,118,119,120,121,122,123,74,99,77,124,125,126,101,127,128,104,85,129,130],"singleton","dots singleton patterns","component","config","state","game","writer","time","shared","contract","as","ecb","gating",{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":31},"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",[],[138,139,140,141,97,122,71,142,143,76,144,145,77,101,146,147,103,148,149,150],"bridge","hybrid","dots hybrid bridge","mesh","assets","Rules","read","view","trigger","unity","material","for","managed",{"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":31},"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,83,160,161,97,162,163,164,99,76,165,166,94,167,26,103,168,169,170],"event driven","driven","event","dots event driven ecs","change","ui","network","command","anti-patterns","pattern","events","static","request",{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":31},"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,179,180,181,182,183,184,185,186,187,188,189,190,191,147,192,149],"valid skill","valid","code review","testing","review","test","routing","code","validation","projects","fixture skill","task","fixture","basic","complete"]