google/filament/filament-lifetime

Claude Code and agent skill by google/filament

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

Enforce correct Filament object creation and destruction lifecycles. Use this skill when initializing rendering pipelines or allocating/deallocating GPU buffers and entities.

Install

npx vskill@latest install google/filament/filament-lifetime

SKILL.md

The same SKILL.md was published earlier as google/filament/filament-lifetime.

Filament object creation and destruction lifecycles

Filament manages its own native allocations. To prevent segmentation faults and memory leaks, follow these rules:

1. ECS Entities & Components

Getting the Entity Manager
  • Preferred Method: Retrieve the EntityManager directly from the Engine instance:

utils::EntityManager& em = engine->getEntityManager();

  • Alternative (Avoid if engine is available): Only use the global singleton if the Engine pointer is inaccessible:

utils::EntityManager& em = utils::EntityManager::get();

Entities
  • Create: Create Entity IDs using the entity manager:

utils::Entity entity = engine->getEntityManager().create();

  • Destroy: Free the Entity ID from the entity manager:

engine->getEntityManager().destroy(entity);

Components
  • Create: Attach components to an existing entity using manager builders:
  • Renderables/Lights: Use RenderableManager::Builder or LightManager::Builder on the entity:

``cpp RenderableManager::Builder(1) .geometry(0, RenderableManager::PrimitiveType::TRIANGLES, vb, ib) .material(0, matInstance) .build(*engine, entity); ``

  • Cameras: Attach a Camera component to the entity:

Camera* camera = engine->createCamera(entity);

  • Destroy (CRITICAL):
  1. To clean up the entire entity:

First, destroy all Filament-managed components on the entity: engine->destroy(entity); Second, free the Entity ID: engine->getEntityManager().destroy(entity); ``cpp // Correct Entity Cleanup engine->destroy(myEntity); engine->getEntityManager().destroy(myEntity); ``

  1. To remove a single component from the entity:

You can destroy specific components individually without deleting the entity:

  • Cameras: engine->destroyCameraComponent(entity);
  • Transforms: engine->getTransformManager().destroy(entity);
  • Renderables: engine->getRenderableManager().destroy(entity);

2. Engine-Managed Native Objects

Native GPU objects are created using the Engine factory or nested Builder patterns.

  • NO `delete`: Never call standard C++ delete on pointers returned by Engine.
  • Direct Factories: Instantiated directly from the Engine instance.
  • Objects: View, Scene, Renderer, SwapChain.
  • Pattern:

``cpp View* view = engine->createView(); // ... engine->destroy(view); ``

  • Builder Pattern: Instantiated using a nested Builder class, passing the engine instance to build(*engine).
  • Objects: VertexBuffer, IndexBuffer, Texture, Material, IndirectLight, Skybox, RenderTarget.
  • Pattern:

``cpp VertexBuffer* vb = VertexBuffer::Builder() .vertexCount(count) .bufferCount(1) .attribute(VertexAttribute::POSITION, 0, VertexBuffer::AttributeType::FLOAT3) .build(*engine); // ... engine->destroy(vb); ``

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 22 Oct 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
20,548
Repository forks
2,270
7-day trend score
50

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/google/filament/filament-lifetime/badge)](https://verified-skill.com/skills/google/filament/filament-lifetime)

Something wrong with this skill or its page? Tell us.