[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6KGCA0PWSZGMS7SRTPQZCP1":3,"skill-same:01M6KGCA0PWSZGMS7SRTPQZCP1":58},{"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":28,"linkOnly":29,"markdownContent":30,"markdownBody":31,"frontMatter":32,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":6,"ownerHtmlUrl":42,"ownerBlogUrl":6,"ownerDescription":43,"updatedAt":44,"install":45,"resources":57},"01M6KGCA0PWSZGMS7SRTPQZCP1","wave5-post-transform-matrix-non-uniform-scale",null,"Apply non-uniform scale to entities using PostTransformMatrix, which is multiplied into LocalToWorld after the standard TRS computation.","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\u002Fwave5-post-transform-matrix-non-uniform-scale\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27],"post","transform","scale","matrix","wave5 post transform matrix non uniform scale","transforms","true","which","apply","2026-11-10 10:12:30",false,"﻿---\nname: wave5-post-transform-matrix-non-uniform-scale\ndescription: Apply non-uniform scale to entities using PostTransformMatrix, which is multiplied into LocalToWorld after the standard TRS computation.\ntags: [transforms]\nmetadata:\n  internal-only: true\n  tier: 3\n---\n\n# PostTransformMatrix — Non-Uniform Scale\n\n## Intent\nApply non-uniform scale to entities using PostTransformMatrix, which is multiplied into LocalToWorld after the standard TRS computation.\n\n## Use When\n- Non-uniform scale needed (e.g., (1, 2, 1) — taller but same width)\n- Squash-and-stretch animation, terrain tile variations, procedurally scaled geometry\n\n## Avoid When\n- Uniform scale is sufficient — use LocalTransform.Scale\n- Non-uniform scale is baked and static — bake into mesh vertices or baked matrix directly\n\n## Senior Pattern\n```csharp\n\u002F\u002F In a custom LocalToWorld system (IJobChunk):\n[BurstCompile]\npublic struct ApplyPostTransformJob : IJobChunk\n{\n    [ReadOnly]  public ComponentTypeHandle\u003CLocalTransform> LocalTransformHandle;\n    public ComponentTypeHandle\u003CLocalToWorld> LocalToWorldHandle;\n    \u002F\u002F Optional — null when absent from chunk\n    [ReadOnly]  public ComponentTypeHandle\u003CPostTransformMatrix> PostTransformMatrixHandle;\n\n    [BurstCompile]\n    public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex,\n        bool useEnableMask, in v128 chunkEnabledMask)\n    {\n        var transforms = chunk.GetNativeArray(ref LocalTransformHandle);\n        var localToWorlds = chunk.GetNativeArray(ref LocalToWorldHandle);\n\n        \u002F\u002F One null check per chunk, not per entity:\n        bool hasPost = chunk.Has(ref PostTransformMatrixHandle);\n        NativeArray\u003CPostTransformMatrix> postArr = hasPost\n            ? chunk.GetNativeArray(ref PostTransformMatrixHandle)\n            : default;\n\n        var enumerator = new ChunkEntityEnumerator(useEnableMask, chunkEnabledMask, chunk.Count);\n        while (enumerator.NextEntityIndex(out var i))\n        {\n            float4x4 trs = transforms[i].ToMatrix();\n            localToWorlds[i] = new LocalToWorld\n            {\n                Value = hasPost ? math.mul(trs, postArr[i].Value) : trs\n            };\n        }\n    }\n}\n\n\u002F\u002F Add PostTransformMatrix in Baker for authoring-time non-uniform scale:\npublic override void Bake(MyAuthoring authoring)\n{\n    var entity = GetEntity(TransformUsageFlags.Dynamic);\n    AddComponent(entity, new PostTransformMatrix\n    {\n        Value = float4x4.Scale(authoring.NonUniformScale)\n    });\n}\n```\n\n## Anti-Patterns\n- Storing non-uniform scale in LocalTransform.Scale — it is a single float; non-uniform values silently truncated to uniform.\n- Ignoring PostTransformMatrix in a custom LocalToWorld system — non-uniform scale silently discarded.\n- Checking HasComponent\u003CPostTransformMatrix> per-entity in hot path — use chunk.Has() which is one check per chunk, not per entity.\n- Wrong multiplication order: `math.mul(postTransform, trs)` — correct order is `math.mul(trs, postTransform)`.\n\n## Runtime Risks\n- GetNativeArray returns default when component absent from chunk — always null-check before indexing.\n- Writing PostTransformMatrix from a parallel job that also writes LocalTransform on same entities — both type handles must be correctly marked (ref vs ReadOnly).\n\n## Performance Notes\n- Optional component check via chunk.Has(): one boolean per chunk, not per entity.\n- Avoids storing full 4x4 matrix in LocalTransform for all entities when only a minority need non-uniform scale.\n\n## Architecture Guidance\n- Correct multiplication order: LocalToWorld.Value = math.mul(standardTRS, postTransform[i].Value).\n- Standard Unity transform system already handles PostTransformMatrix — only custom transform systems need to implement this manually.\n- Prefer PostTransformMatrix over modifying mesh vertices at runtime for dynamic non-uniform scale.\n\n## Related Skills\n[[local-transform-write-pattern]], [[local-to-world-read-only-contract]], [[write-group-custom-transform]], [[wave4-ijobchunk-full-anatomy]]\n","# PostTransformMatrix — Non-Uniform Scale\n\n## Intent\nApply non-uniform scale to entities using PostTransformMatrix, which is multiplied into LocalToWorld after the standard TRS computation.\n\n## Use When\n- Non-uniform scale needed (e.g., (1, 2, 1) — taller but same width)\n- Squash-and-stretch animation, terrain tile variations, procedurally scaled geometry\n\n## Avoid When\n- Uniform scale is sufficient — use LocalTransform.Scale\n- Non-uniform scale is baked and static — bake into mesh vertices or baked matrix directly\n\n## Senior Pattern\n```csharp\n\u002F\u002F In a custom LocalToWorld system (IJobChunk):\n[BurstCompile]\npublic struct ApplyPostTransformJob : IJobChunk\n{\n    [ReadOnly]  public ComponentTypeHandle\u003CLocalTransform> LocalTransformHandle;\n    public ComponentTypeHandle\u003CLocalToWorld> LocalToWorldHandle;\n    \u002F\u002F Optional — null when absent from chunk\n    [ReadOnly]  public ComponentTypeHandle\u003CPostTransformMatrix> PostTransformMatrixHandle;\n\n    [BurstCompile]\n    public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex,\n        bool useEnableMask, in v128 chunkEnabledMask)\n    {\n        var transforms = chunk.GetNativeArray(ref LocalTransformHandle);\n        var localToWorlds = chunk.GetNativeArray(ref LocalToWorldHandle);\n\n        \u002F\u002F One null check per chunk, not per entity:\n        bool hasPost = chunk.Has(ref PostTransformMatrixHandle);\n        NativeArray\u003CPostTransformMatrix> postArr = hasPost\n            ? chunk.GetNativeArray(ref PostTransformMatrixHandle)\n            : default;\n\n        var enumerator = new ChunkEntityEnumerator(useEnableMask, chunkEnabledMask, chunk.Count);\n        while (enumerator.NextEntityIndex(out var i))\n        {\n            float4x4 trs = transforms[i].ToMatrix();\n            localToWorlds[i] = new LocalToWorld\n            {\n                Value = hasPost ? math.mul(trs, postArr[i].Value) : trs\n            };\n        }\n    }\n}\n\n\u002F\u002F Add PostTransformMatrix in Baker for authoring-time non-uniform scale:\npublic override void Bake(MyAuthoring authoring)\n{\n    var entity = GetEntity(TransformUsageFlags.Dynamic);\n    AddComponent(entity, new PostTransformMatrix\n    {\n        Value = float4x4.Scale(authoring.NonUniformScale)\n    });\n}\n```\n\n## Anti-Patterns\n- Storing non-uniform scale in LocalTransform.Scale — it is a single float; non-uniform values silently truncated to uniform.\n- Ignoring PostTransformMatrix in a custom LocalToWorld system — non-uniform scale silently discarded.\n- Checking HasComponent\u003CPostTransformMatrix> per-entity in hot path — use chunk.Has() which is one check per chunk, not per entity.\n- Wrong multiplication order: `math.mul(postTransform, trs)` — correct order is `math.mul(trs, postTransform)`.\n\n## Runtime Risks\n- GetNativeArray returns default when component absent from chunk — always null-check before indexing.\n- Writing PostTransformMatrix from a parallel job that also writes LocalTransform on same entities — both type handles must be correctly marked (ref vs ReadOnly).\n\n## Performance Notes\n- Optional component check via chunk.Has(): one boolean per chunk, not per entity.\n- Avoids storing full 4x4 matrix in LocalTransform for all entities when only a minority need non-uniform scale.\n\n## Architecture Guidance\n- Correct multiplication order: LocalToWorld.Value = math.mul(standardTRS, postTransform[i].Value).\n- Standard Unity transform system already handles PostTransformMatrix — only custom transform systems need to implement this manually.\n- Prefer PostTransformMatrix over modifying mesh vertices at runtime for dynamic non-uniform scale.\n\n## Related Skills\n[[local-transform-write-pattern]], [[local-to-world-read-only-contract]], [[write-group-custom-transform]], [[wave4-ijobchunk-full-anatomy]]\n",{"name":5,"tags":33,"metadata":34,"description":7},[24],{"tier":35,"internal-only":36},3,true,"main","fe4746b9f07e6c7c2b6d3932002183af9b9f6fa2",".claude\u002Fskills\u002Funity-dots\u002Fwave5-post-transform-matrix-non-uniform-scale",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":46,"prompt":56,"zipAvailable":36},[47,50,53],{"tool":48,"command":49},"npx","npx skills add dyCuong03\u002Funity-agent-team --skill wave5-post-transform-matrix-non-uniform-scale",{"tool":51,"command":52},"bunx","bunx skills add dyCuong03\u002Funity-agent-team --skill wave5-post-transform-matrix-non-uniform-scale",{"tool":54,"command":55},"pnpm","pnpm dlx skills add dyCuong03\u002Funity-agent-team --skill wave5-post-transform-matrix-non-uniform-scale","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FdyCuong03\u002Funity-agent-team\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Funity-dots\u002Fwave5-post-transform-matrix-non-uniform-scale\u002FSKILL.md",[],[59,84,106,131,151,172],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":28},"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",[],[66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83],"update","dots update groups","boundary","simulation","how","system","choose","work","use","never","peer","deterministic","how to","coupling","ecs","bugs","frame","value",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":28},"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",[],[91,20,92,93,68,71,94,95,74,96,97,98,99,100,22,101,102,103,104,105],"patterns","dots transform patterns","components","mount","model","cost","runtime","systems","input","with","socket","at","child","custom","hierarchy",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":117,"publishedAt":28},"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",[112],{"categoryNo":113,"categoryName":114,"taxonomyType":115,"taxonomyTypeDesc":116},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[91,118,119,120,121,122,123,71,95,74,124,125,126,97,127,128,100,82,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":28},"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,93,122,68,142,143,73,144,145,74,97,146,147,99,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":28},"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,80,160,161,93,162,163,164,95,73,165,166,91,167,168,99,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":28},"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,147,204,149],"valid skill","valid","code review","testing","review","test","routing","code","validation","projects","fixture skill","task","fixture","basic","complete"]