[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGA8XG2QF7BDDFFKGPYBFV":3,"skill-same:01M6KGA8XG2QF7BDDFFKGPYBFV":62},{"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":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":61},"01M6KGA8XG2QF7BDDFFKGPYBFV","wave4-native-disable-container-safety-restriction",null,"Allow each parallel worker in IJobChunk to hold its own per-thread scratch NativeContainer by opting out of the safety system''s shared-container restriction.","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\u002Fwave4-native-disable-container-safety-restriction\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31],"Safety","container","native","wave4 native disable container safety restriction","containers","system","parallel","jobs","shared","worker","true","thread","native-containers","2026-11-10 10:12:30",false,"﻿---\nname: wave4-native-disable-container-safety-restriction\ndescription: Allow each parallel worker in IJobChunk to hold its own per-thread scratch NativeContainer by opting out of the safety system''s shared-container restriction.\ntags: [jobs, native-containers]\nmetadata:\n  internal-only: true\n  tier: 3\n---\n\n# NativeDisableContainerSafetyRestriction — Per-Thread Scratch\n\n## Intent\nAllow each parallel worker in IJobChunk to hold its own per-thread scratch NativeContainer by opting out of the safety system's shared-container restriction.\n\n## Use When\n- IJobChunk needs per-chunk working memory (scratch buffer, priority queue, temporary list).\n- Each chunk's `Execute()` call receives a copy of the job struct, guaranteeing no sharing between workers.\n\n## Avoid When\n- Container is truly shared across workers — use `NativeParallelMultiHashMap.AsParallelWriter()` instead.\n- Using IJobParallelFor — job struct copy semantics differ; IJobChunk is safer for this pattern.\n\n## Senior Pattern\n```csharp\n[BurstCompile]\npublic struct NearestNeighborJob : IJobChunk\n{\n    \u002F\u002F Per-thread ownership guaranteed by IJobChunk copy-per-chunk semantics.\n    \u002F\u002F Safety restriction disabled because each worker has its own copy.\n    [NativeDisableContainerSafetyRestriction]\n    public NativePriorityHeap\u003Cfloat> Scratch;\n\n    [BurstCompile]\n    public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex,\n        bool useEnableMask, in v128 chunkEnabledMask)\n    {\n        \u002F\u002F Lazy init — Scratch is uninitialized on first Execute per chunk\n        if (!Scratch.IsCreated)\n            Scratch = new NativePriorityHeap\u003Cfloat>(16, Allocator.Temp);\n\n        var enumerator = new ChunkEntityEnumerator(useEnableMask, chunkEnabledMask, chunk.Count);\n        while (enumerator.NextEntityIndex(out var i))\n        {\n            Scratch.Push(\u002F* distance for entity i *\u002F);\n        }\n        \u002F\u002F Allocator.Temp — auto-disposed when job completes on this worker\n    }\n}\n```\n\n## Anti-Patterns\n- Using `[NativeDisableContainerSafetyRestriction]` on a container that IS shared between workers — silent race, impossible to detect in Burst release builds.\n- Forgetting `IsCreated` check — Burst-compiled null-ref crashes worker thread.\n- Using `Allocator.Persistent` for scratch — leaks if job is abandoned; use `Allocator.Temp`.\n\n## Runtime Risks\n- Safety system cannot protect after opt-out — correctness depends entirely on developer's guarantee of per-thread ownership.\n- IJobChunk guarantees one copy of job struct per chunk dispatch; IJobParallelFor does NOT give the same guarantee in all Unity versions.\n\n## Performance Notes\n- `Allocator.Temp` inside Burst job = thread-local storage, essentially free allocation.\n- Enables O(n) algorithms (nearest-neighbor, convex hull) without pre-allocated global arrays.\n\n## Architecture Guidance\nIJobChunk guarantees per-chunk copy semantics — each worker thread receives its own copy of the job struct, so each worker has its own `Scratch` instance. This is why the opt-out is safe here specifically. Always document the per-thread ownership guarantee at the field declaration.\n\n## Related Skills\n[[ijobchunk-full-anatomy]], [[ijobchunk-chunk-job]]\n","# NativeDisableContainerSafetyRestriction — Per-Thread Scratch\n\n## Intent\nAllow each parallel worker in IJobChunk to hold its own per-thread scratch NativeContainer by opting out of the safety system's shared-container restriction.\n\n## Use When\n- IJobChunk needs per-chunk working memory (scratch buffer, priority queue, temporary list).\n- Each chunk's `Execute()` call receives a copy of the job struct, guaranteeing no sharing between workers.\n\n## Avoid When\n- Container is truly shared across workers — use `NativeParallelMultiHashMap.AsParallelWriter()` instead.\n- Using IJobParallelFor — job struct copy semantics differ; IJobChunk is safer for this pattern.\n\n## Senior Pattern\n```csharp\n[BurstCompile]\npublic struct NearestNeighborJob : IJobChunk\n{\n    \u002F\u002F Per-thread ownership guaranteed by IJobChunk copy-per-chunk semantics.\n    \u002F\u002F Safety restriction disabled because each worker has its own copy.\n    [NativeDisableContainerSafetyRestriction]\n    public NativePriorityHeap\u003Cfloat> Scratch;\n\n    [BurstCompile]\n    public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex,\n        bool useEnableMask, in v128 chunkEnabledMask)\n    {\n        \u002F\u002F Lazy init — Scratch is uninitialized on first Execute per chunk\n        if (!Scratch.IsCreated)\n            Scratch = new NativePriorityHeap\u003Cfloat>(16, Allocator.Temp);\n\n        var enumerator = new ChunkEntityEnumerator(useEnableMask, chunkEnabledMask, chunk.Count);\n        while (enumerator.NextEntityIndex(out var i))\n        {\n            Scratch.Push(\u002F* distance for entity i *\u002F);\n        }\n        \u002F\u002F Allocator.Temp — auto-disposed when job completes on this worker\n    }\n}\n```\n\n## Anti-Patterns\n- Using `[NativeDisableContainerSafetyRestriction]` on a container that IS shared between workers — silent race, impossible to detect in Burst release builds.\n- Forgetting `IsCreated` check — Burst-compiled null-ref crashes worker thread.\n- Using `Allocator.Persistent` for scratch — leaks if job is abandoned; use `Allocator.Temp`.\n\n## Runtime Risks\n- Safety system cannot protect after opt-out — correctness depends entirely on developer's guarantee of per-thread ownership.\n- IJobChunk guarantees one copy of job struct per chunk dispatch; IJobParallelFor does NOT give the same guarantee in all Unity versions.\n\n## Performance Notes\n- `Allocator.Temp` inside Burst job = thread-local storage, essentially free allocation.\n- Enables O(n) algorithms (nearest-neighbor, convex hull) without pre-allocated global arrays.\n\n## Architecture Guidance\nIJobChunk guarantees per-chunk copy semantics — each worker thread receives its own copy of the job struct, so each worker has its own `Scratch` instance. This is why the opt-out is safe here specifically. Always document the per-thread ownership guarantee at the field declaration.\n\n## Related Skills\n[[ijobchunk-full-anatomy]], [[ijobchunk-chunk-job]]\n",{"name":5,"tags":37,"metadata":38,"description":7},[26,31],{"tier":39,"internal-only":40},3,true,"main","fe4746b9f07e6c7c2b6d3932002183af9b9f6fa2",".claude\u002Fskills\u002Funity-dots\u002Fwave4-native-disable-container-safety-restriction",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":50,"prompt":60,"zipAvailable":40},[51,54,57],{"tool":52,"command":53},"npx","npx skills add dyCuong03\u002Funity-agent-team --skill wave4-native-disable-container-safety-restriction",{"tool":55,"command":56},"bunx","bunx skills add dyCuong03\u002Funity-agent-team --skill wave4-native-disable-container-safety-restriction",{"tool":58,"command":59},"pnpm","pnpm dlx skills add dyCuong03\u002Funity-agent-team --skill wave4-native-disable-container-safety-restriction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave4-native-disable-container-safety-restriction\u002FSKILL.md",[],[63,87,111,135,155,176],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":32},"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",[],[70,71,72,73,74,24,75,76,77,78,79,80,81,82,83,84,85,86],"update","dots update groups","boundary","simulation","how","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":32},"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,72,24,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":122,"publishedAt":32},"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",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":120,"taxonomyTypeDesc":121},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[94,123,124,125,126,127,128,24,99,77,129,130,27,101,131,132,104,85,133,134],"singleton","dots singleton patterns","component","config","state","game","writer","time","contract","as","ecb","gating",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":32},"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",[],[142,143,144,145,97,127,72,146,147,76,148,149,77,101,150,151,103,152,153,154],"bridge","hybrid","dots hybrid bridge","mesh","assets","Rules","read","view","trigger","unity","material","for","managed",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":32},"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",[],[162,163,83,164,165,97,166,167,168,99,76,169,170,94,171,172,103,173,174,175],"event driven","driven","event","dots event driven ecs","change","ui","network","command","anti-patterns","pattern","structural","events","static","request",{"skillNo":177,"name":178,"nameZh":6,"description":179,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":180,"categories":181,"keywords":193,"publishedAt":32},"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",[182,187,190],{"categoryNo":183,"categoryName":184,"taxonomyType":185,"taxonomyTypeDesc":186},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":188,"categoryName":189,"taxonomyType":185,"taxonomyTypeDesc":186},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":191,"categoryName":192,"taxonomyType":185,"taxonomyTypeDesc":186},"01JBSEEDCAT000000000000023","Skill与智能体开发",[194,195,196,197,198,199,200,201,202,203,204,205,206,207,151,208,153],"valid skill","valid","code review","testing","review","test","routing","code","validation","projects","fixture skill","task","fixture","basic","complete"]