[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M698XRXR5Q463GQ03RDBD9FR":3,"skill-same:01M698XRXR5Q463GQ03RDBD9FR":60},{"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":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":41,"ownerHtmlUrl":42,"ownerBlogUrl":43,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M698XRXR5Q463GQ03RDBD9FR","filament-lifetime",null,"Enforce correct Filament object creation and destruction lifecycles. Use this skill when initializing rendering pipelines or allocating\u002Fdeallocating GPU buffers and entities.","google\u002Ffilament","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698W8SGYAMBEGYBK16J57R1",20747,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Ftools\u002Fai\u002Fagents\u002Fskills\u002Ffilament_lifetime\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30],"filament lifetime","gpu","correct","use","pipelines","enforce","creation","rendering","destruction","object","when","entities","2026-11-10 10:12:30",false,"---\nname: filament-lifetime\ndescription: >\n  Enforce correct Filament object creation and destruction lifecycles.\n  Use this skill when initializing rendering pipelines or allocating\u002Fdeallocating GPU buffers and entities.\n---\n\n# Filament object creation and destruction lifecycles\n\nFilament manages its own native allocations. To prevent segmentation faults and memory leaks, follow these rules:\n\n## 1. ECS Entities & Components\n#### Getting the Entity Manager\n*   **Preferred Method**: Retrieve the `EntityManager` directly from the `Engine` instance:\n    `utils::EntityManager& em = engine->getEntityManager();`\n*   **Alternative (Avoid if engine is available)**: Only use the global singleton if the `Engine` pointer is inaccessible:\n    `utils::EntityManager& em = utils::EntityManager::get();`\n\n#### Entities\n*   **Create**: Create Entity IDs using the entity manager:\n    `utils::Entity entity = engine->getEntityManager().create();`\n*   **Destroy**: Free the Entity ID from the entity manager:\n    `engine->getEntityManager().destroy(entity);`\n\n#### Components\n*   **Create**: Attach components to an existing entity using manager builders:\n    *   *Renderables\u002FLights*: Use `RenderableManager::Builder` or `LightManager::Builder` on the entity:\n        ```cpp\n        RenderableManager::Builder(1)\n            .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vb, ib)\n            .material(0, matInstance)\n            .build(*engine, entity);\n        ```\n    *   *Cameras*: Attach a Camera component to the entity:\n        `Camera* camera = engine->createCamera(entity);`\n*   **Destroy (CRITICAL)**:\n    1.  **To clean up the entire entity**:\n        First, destroy all Filament-managed components on the entity:\n        `engine->destroy(entity);`\n        Second, free the Entity ID:\n        `engine->getEntityManager().destroy(entity);`\n        ```cpp\n        \u002F\u002F Correct Entity Cleanup\n        engine->destroy(myEntity);\n        engine->getEntityManager().destroy(myEntity);\n        ```\n    2.  **To remove a single component from the entity**:\n        You can destroy specific components individually without deleting the entity:\n        *   *Cameras*: `engine->destroyCameraComponent(entity);`\n        *   *Transforms*: `engine->getTransformManager().destroy(entity);`\n        *   *Renderables*: `engine->getRenderableManager().destroy(entity);`\n\n## 2. Engine-Managed Native Objects\nNative GPU objects are created using the `Engine` factory or nested `Builder` patterns.\n*   **NO `delete`**: Never call standard C++ `delete` on pointers returned by `Engine`.\n*   **Direct Factories**: Instantiated directly from the `Engine` instance.\n    *   *Objects*: `View`, `Scene`, `Renderer`, `SwapChain`.\n    *   *Pattern*:\n        ```cpp\n        View* view = engine->createView();\n        \u002F\u002F ...\n        engine->destroy(view);\n        ```\n*   **Builder Pattern**: Instantiated using a nested `Builder` class, passing the engine instance to `build(*engine)`.\n    *   *Objects*: `VertexBuffer`, `IndexBuffer`, `Texture`, `Material`, `IndirectLight`, `Skybox`, `RenderTarget`.\n    *   *Pattern*:\n        ```cpp\n        VertexBuffer* vb = VertexBuffer::Builder()\n            .vertexCount(count)\n            .bufferCount(1)\n            .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT3)\n            .build(*engine);\n        \u002F\u002F ...\n        engine->destroy(vb);\n        ```\n","# Filament object creation and destruction lifecycles\n\nFilament manages its own native allocations. To prevent segmentation faults and memory leaks, follow these rules:\n\n## 1. ECS Entities & Components\n#### Getting the Entity Manager\n*   **Preferred Method**: Retrieve the `EntityManager` directly from the `Engine` instance:\n    `utils::EntityManager& em = engine->getEntityManager();`\n*   **Alternative (Avoid if engine is available)**: Only use the global singleton if the `Engine` pointer is inaccessible:\n    `utils::EntityManager& em = utils::EntityManager::get();`\n\n#### Entities\n*   **Create**: Create Entity IDs using the entity manager:\n    `utils::Entity entity = engine->getEntityManager().create();`\n*   **Destroy**: Free the Entity ID from the entity manager:\n    `engine->getEntityManager().destroy(entity);`\n\n#### Components\n*   **Create**: Attach components to an existing entity using manager builders:\n    *   *Renderables\u002FLights*: Use `RenderableManager::Builder` or `LightManager::Builder` on the entity:\n        ```cpp\n        RenderableManager::Builder(1)\n            .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vb, ib)\n            .material(0, matInstance)\n            .build(*engine, entity);\n        ```\n    *   *Cameras*: Attach a Camera component to the entity:\n        `Camera* camera = engine->createCamera(entity);`\n*   **Destroy (CRITICAL)**:\n    1.  **To clean up the entire entity**:\n        First, destroy all Filament-managed components on the entity:\n        `engine->destroy(entity);`\n        Second, free the Entity ID:\n        `engine->getEntityManager().destroy(entity);`\n        ```cpp\n        \u002F\u002F Correct Entity Cleanup\n        engine->destroy(myEntity);\n        engine->getEntityManager().destroy(myEntity);\n        ```\n    2.  **To remove a single component from the entity**:\n        You can destroy specific components individually without deleting the entity:\n        *   *Cameras*: `engine->destroyCameraComponent(entity);`\n        *   *Transforms*: `engine->getTransformManager().destroy(entity);`\n        *   *Renderables*: `engine->getRenderableManager().destroy(entity);`\n\n## 2. Engine-Managed Native Objects\nNative GPU objects are created using the `Engine` factory or nested `Builder` patterns.\n*   **NO `delete`**: Never call standard C++ `delete` on pointers returned by `Engine`.\n*   **Direct Factories**: Instantiated directly from the `Engine` instance.\n    *   *Objects*: `View`, `Scene`, `Renderer`, `SwapChain`.\n    *   *Pattern*:\n        ```cpp\n        View* view = engine->createView();\n        \u002F\u002F ...\n        engine->destroy(view);\n        ```\n*   **Builder Pattern**: Instantiated using a nested `Builder` class, passing the engine instance to `build(*engine)`.\n    *   *Objects*: `VertexBuffer`, `IndexBuffer`, `Texture`, `Material`, `IndirectLight`, `Skybox`, `RenderTarget`.\n    *   *Pattern*:\n        ```cpp\n        VertexBuffer* vb = VertexBuffer::Builder()\n            .vertexCount(count)\n            .bufferCount(1)\n            .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT3)\n            .build(*engine);\n        \u002F\u002F ...\n        engine->destroy(vb);\n        ```\n",{"name":5,"description":7},"main","fd9ec7ff9510df148011c5326bcb50d4bfb811ca","tools\u002Fai\u002Fagents\u002Fskills\u002Ffilament_lifetime",2305,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament","https:\u002F\u002Fgoogle.github.io\u002Ffilament\u002F","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 13:54:43",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add google\u002Ffilament --skill filament-lifetime",{"tool":52,"command":53},"bunx","bunx skills add google\u002Ffilament --skill filament-lifetime",{"tool":55,"command":56},"pnpm","pnpm dlx skills add google\u002Ffilament --skill filament-lifetime","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Ftools\u002Fai\u002Fagents\u002Fskills\u002Ffilament_lifetime\u002FSKILL.md",true,[],[61,79,95,117,133,144],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":31},"01M698XTTZP1MWPYW9EVV7DF2Q","filament-math","Enforce correct mathematical primitives and naming conventions in Filament code. Use this skill when performing coordinate transformations, vector math, or projection setups.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Ftools\u002Fai\u002Fagents\u002Fskills\u002Ffilament_math\u002FSKILL.md",[],[68,69,29,70,71,72,73,74,75,24,76,22,21,77,78],"math","filament math","primitives","performing","naming conventions","naming","Mathematical","conventions","coordinate","vector","code",{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":31},"01M698XQ0E9RE6RDFYKS2PF1S1","cherry-pick","Cherry-pick a commit onto another branch and open the PR. Use when the user asks to cherry-pick or backport a commit or PR to a release branch.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Fthird_party\u002Fdawn\u002Fthird_party\u002Fdirectx-shader-compiler\u002Fsrc\u002F.github\u002Fskills\u002Fcherry-pick\u002FSKILL.md",[],[86,87,88,89,90,91,92,29,22,93,94],"pick","cherry pick","commit","pr","release","backport","open","user","branch",{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":31},"01M698XN2P44Y956SJRD7CPB22","verification-protocols","Standard verification pipeline to execute after modifying C++ source or header files. Use this skill to format includes, build the engine, and run core tests.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Fskills\u002Fverification_protocols\u002FSKILL.md",[],[102,103,104,105,106,107,108,22,109,110,111,112,113,114,115,116],"verification protocols","protocols","verification","standard","c++","build","tests","files","source","execute","core","run","pipeline","format","engine",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":31},"01M698XK6J428QZM1WGVWW50JE","preprocessor-guard-hygiene","Enforce preprocessor guard rules and macro-dependent inclusion hygiene in C++. Use this skill when modifying conditional imports or preprocessor directives.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Fskills\u002Fpreprocessor_guard_hygiene\u002FSKILL.md",[],[124,125,126,127,128,22,24,106,129,130,131,132,29],"guard","preprocessor guard hygiene","hygiene","macro","Rules","inclusion","imports","conditional","directives",{"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":31},"01M698XHA1J01F915DKYHXZ18C","header-self-containment","Enforce strict header self-containment so that every header file compiles independently. Use this skill when creating or modifying C++ header files.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Fskills\u002Fheader_self_containment\u002FSKILL.md",[],[140,141,142,106,24,109,22,143,29],"self","containment","header self containment","file",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":155,"publishedAt":31},"01M698XEWJYPD7AB62DAQ3RMMC","filament-desktop-testing","Execute unit tests and performance benchmarks for Filament on desktop platforms. Use this skill to run and filter tests or benchmarks locally.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Ffilament\u002Fblob\u002Fmain\u002Fskills\u002Ffilament_desktop_testing\u002FSKILL.md",[150],{"categoryNo":151,"categoryName":152,"taxonomyType":153,"taxonomyTypeDesc":154},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[156,157,158,159,160,161,162,163,108,164,22,111,113,165,166],"desktop testing","filament desktop testing","testing","desktop","performance benchmarks","for","unit","filter","benchmarks","unit tests","performance"]